To decide if (n - a number) is between (a - a number) and (b - a number): if n is at least a and n is at most b, yes; no. |
To say the or-separated list of (the collection - a description): let N be the number of members of the collection; repeat with item running through the collection: say "[the item]"; decrease N by 1; if N is 1, say " or "; if N > 1, say ", "; |
A scene has a rulebook called the scene-script. The null-rulebook is a rulebook. The scene-script of a scene is usually the null-rulebook. A scene has a number called the beat. The playback beat is a number that varies. A scene can be counting or uncounting. A scene is usually uncounting. Every turn (this is the play scene scripts rule): repeat with i running through happening scenes: if i is counting, increase the beat of i by one; now the playback beat is the beat of i; if the scene-script of i are not the null-rulebook: consider the scene-script of i. |
Meeting Jake is a counting scene. Jakes-Script is a rulebook. The scene-script of Meeting Jake is the Jakes-Script rulebook. Meeting Jake begins when the location is the Pool Hall. Jakes-Script rule when Pool Game Question is not spoken and the playback beat is between 3 and 5: say "'So?' Jake demands. 'You want to play a game?'" instead. |
To say by (N - a number) -- beginning say_by_index:
(-
switch(({N} % ( {-segment-count} ))) { 0:
-).
To say or -- continuing say_by_index:
(-
{-segment-count}:
-).
To say end -- ending say_by_index:
(- {-close-brace} -).
|
The following short example demonstrates the substitution in use. The Study is a room. The study has a number called the index. Every turn: increase the index of the study by a random number between 1 and 3; say "[index of the study] - [by the index of the study]A[or]B[or]C[end]."; |
| Home | - | Inform 7 website |