Hello! I am brand new to this whole thing, and I've been hoping to make an on-page multiple choice type thing, which I've seen done with cycling links which can apparently be done with sugarcube, but I'm using harlowe currently, and am fairly clueless!
I found this thread
2.0 cycling typeerror problem
which describes this code
(set: $cycle to 0)
You can't accept second place! You're no |phrase>[short-nosed horse!] It's back to training for you!
(click-replace: ?phrase)[(set: $cycle to (it + 1) % 3) (if: $cycle is 0)[short-nosed horse!](else-if: $cycle is 1)[silver athlete!](else-if: $cycle is 2)[partner to greatness!]]
but when I try it, it's not a repeatable action, I just always get the second choice and then it's no longer a link.
any help on either fixing the code to be repeatable?
Comments
The following example consists of two passages, I named them Main & Logic but you can name they whatever you like.
Main - contains the basic text with a hook and the main (click-replace:) macro:
Logic - contains the logic to work out what to display in the hook based on $cycle as well as the re-attaching (click-replace:) macro: note: the re-attaching (click-replace:) macro is exactly like the main (click-replace:) macro.
The follows is the above re-formated to make it easier to read:
I like having sample recipe code for stuff, it makes it a lot easier to figure out how to think in this format.