Looping knots
A knot can divert to itself. This fundamental concept is an important part of the advanced dialog and narrative structures in ink. However, care must be taken when having knots divert to themselves or in a looping pattern. It can become very easy to create infinite loops where the code loops without stopping. To prevent this error, it is always a good idea to include a weave with at least one choice whose content ends the story or breaks the loop.
By combining choices, diverts, and knots, looping structures can be created. Within these structures, sticky choices become important for creating consistent options for readers to choose from during each loop.
Looping structures
The most basic looping structure has two choices. The first continues the loop and the second must end the story somehow, as illustrated in the following code example:
Example 6
You look at the rock in front of you. -> rock == rock * Push the rock up the hill. ...