I recommend you start posting specific questions in the Twine forum from here on out, but here is the code based on redirecting (or using go-to).
In the first passage that the player sees, you have a link to your logic passage:
[[ Continue ->Figure Stuff Out]]
…then when the user clicks that link, the passage will disappear and Harlowe will load the “Figure Stuff Out” passage:
{
(set: $something to "whatever")
(set: $number to 42)
(go-to: "Present Stuff")
}
…however, because there is no actual information to display to the user and the passage has a (go-to:)
macro, it goes to the next “Present Stuff” passage without making it noticeable to the user:
See if the variables came through:
(if: $something is "whatever")[ The answer is $number ]
I used (go-to:)
instead of (redirect:)
because some variables didn’t update properly when hitting the refresh in the browser. I’m not sure why I had some issues with redirecting over go-toing, but read up on both to understand them better. However, remember that the user should be able to refresh the browser and the game should not skip a beat.
Of course, this is only useful if you wish to put a lot of code into a logic passage. Most authors will simply calculate what they need and then move on all in one chunk on the passage that requires it, such as:
(link:"Continue")[
(set: $something to "whatever")
(set: $number to 42)
(go-to: "Present Stuff")
]
…and bypass the need for a passage that merely redirects. Still, you can embed a passage within another using (display:)
and just use that code again if need be. This is useful for re-using visible chunks of code that the player sees, for example.
I don’t really see the need for using a separate passage for just story logic though. If you did find yourself re-using a block of logic code over and over again, just make a your own custom (macro:)
for it and save it to a $story
variable.
Again, seek the result, do not look for a specific process. Otherwise, you’ll miss the obvious answers in most cases. There are a lot of Harlowe questions online that have already been solved many times over. There is nothing in what you’ve described thus far as difficult to do in Harlowe or Twine.
Good luck!