code, howto, Ink

Learning Ink: Part 5: Alternatives, Sequences, Cycles, and Shuffles



Learning Ink


Ink is a scripting language for creating interactive fiction like choose-you-own-adventures and other vast, branching stories.



In Ink, Alternatives are text within curly brackets, {}. They have already been introduced as part of determining if a knot (or stitch) has been visited. When used with text strings, they can be used to introduce “alternative” text.




By default, the values within the curly brackets will move in sequence from one to another until it reaches the end. It will then stop at the last value and repeat it.




To have the text strings repeat, create a “cycle” of values using the “&” symbol within the curly brackets.


Using cycles, values can be repeat within loops.



Within alternatives, entries can also be selected at random. This is called a shuffle. It uses the tilde, ~.


For each run of the shuffle, a new value will be chosen.



GitHub Gist Version:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s