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

InkLogo

 

Learning Ink

 

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


 

Alternatives

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.

1_Alternatives

 

Sequences

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.

Sequences

 

Cycles

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

2_Cycles

Using cycles, values can be repeat within loops.

Cycles

Shuffles

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

3_Shuffle

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

Shuffle

 

GitHub Gist Version:

INCLUDE Dinner
INCLUDE GettingReady
It was {~Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday}.
I was unsure about asking him out on a date.
CHAPTER 1: ASKING HIM OUT
-> Chapter_1
=== Chapter_1 ===
{&What should I do? | What if I didn't say anything? | Should I ask him out?}
+ {Chapter_1} [Did he even like guys?]
-> Chapter_1
* {Chapter_1} I should just do it!
I let it go for weeks. Finally, I asked him out.
-> Chapter_2
=== Chapter_2 ===
CHAPTER 2: GETTING READY
Why hadn't I thought about what I was going to wear?
Here I am, 30 minutes before the date and I haven't picked out my clothes!
* Pick out something good
-> Getting_Ready.Pick_Out_Something_Good
* Don't bother
-> Getting_Ready.Just_Grab_Something
-> Chapter_3
=== Chapter_3 ===
CHAPTER 3: EATING DINNER
-> Dinner

view raw
ChoicesAndKnots.ink
hosted with ❤ by GitHub