version 4 by Jon Ingold
Example: ** Hamlet as IF - Making a kind with a varying strings as part of its properties, but that remembers different states for different instances of that kind.
"Hamlet as IF"
Include Text Variations by Jon Ingold.
Colour is a kind of value. The colours are red, green, blue, purple, black, white, yellow.
Each button will produce a randomly selected method of assassination. The "sticky random" ending will ensure that these don't change every time the room description is printed. However, each button will be different because of the inclusion of the "tip buffer" inside the varying block. The number to tip the buffer (called "offset") is unique (hopefully) to each button.
A button is a kind of thing. "The [colour] button would unleash [one of]a swarm of killer bees[or]a grizzly bear[or]the deadly Mintenka virus[or]jets of flame[or]a murder of scorpions[tip buffer offset][sticky random]." A button has a colour. Understand the colour property as referring to a button.
However, when pushing a button, we want the game to scroll through options regardless of which button we choose. Here we don't use a tip buffer call.
Instead of pushing a button, say "[one of]That would do it. One push - and he would be dead.[or]But would it be right? Would that be honest?[or]But what if you're wrong? What if it's not the right thing to do?[or]You can't bring yourself to do it.[stopping]". A button has a number called offset.
We must set up tip buffers at the start. They can be random, or simply numbered 1 to 7. The advantage of randomness is, if you introduce another button, you do not need to extend this loop at all. Furthermore, should any buttons end up with the same offset, that will merely cause two buttons to have the same description, which will not manifest as a bug.
When play begins:
repeat with item running through buttons begin;
change the offset of the item to a random number from 1 to 100;
The Retribution Room is a room. In the Retribution Room is a red button, a green button, a blue button, a purple button, a black button, a white button and a yellow button.