Chapter 10 - The Terminator
Section - Allowing the player to set the parameters
The display banner rule is not listed in the startup rulebook.
The initial room description rule is not listed in the startup rulebook. [Gonna do these after we ask for parameters. And the prebanner rule comes then too.]
The time to terminator is initially 50.
The terminator speed is initially 3.
Stage is a kind of value. The stages are setting time, setting speed, and playing. The current stage is initially setting time.
To start the game for real:
now the current stage is playing;
follow the print the pre-banner rule;
follow the display banner rule;
follow the initial room description rule.
When play begins (this is the gather parameters rule):
say "Would you like to set the game parameters? The default values are that it takes [time to terminator] turns for the terminator to appear in the east, and then it moves one unit across the grid every [terminator speed] turns.[line break](Please type yes or no.)>";
unless the player consents:
start the game for real;
otherwise:
say "What would you like the time until the appearance of the terminator to be?".
After reading a command when the current stage is setting time:
let the inputted number be -1;
if the player's command includes "[number]":
now the inputted number is the number understood;
if the inputted number is less than 0:
say "Please input a number that is at least 0.";
otherwise:
now the time to terminator is the inputted number;
now the current stage is setting speed;
say "OK. How many turns should the terminator take to move one grid space?[line break]If you input a negative number, like -3, the terminator will move that many spaces every turn. If you input 0, the whole map will light up as soon as the terminator arrives.";
reject the player's command.
After reading a command when the current stage is setting speed:
if the player's command includes "[number]":
now the terminator speed is the number understood;
say "OK.";
start the game for real;
otherwise:
say "Please input a number.";
reject the player's command.