The good news is that the code allows me to control the number of turns between each print out, but I’ve encountered two new problems as a result of the code.
[code]Food is a kind of thing. Food is usually edible. Food has a time called the satisfaction period. The satisfaction period of a food is usually 2 minutes.
A person can be hungry or replete. The player is hungry.
Check eating something:
if the noun is not food, say “You can’t eat that!” instead.
Carry out eating something:
now the player is replete;
hunger resumes in the satisfaction period of the noun from now.
At the time when hunger resumes:
starvation occurs in 10 minutes from now;
now the turn offset is the remainder after dividing turn count by the set number of turns;
now line count is one;
now the player is hungry.
At the time when starvation occurs:
if the player is hungry, end the game saying “You have starved to death.”.
Line count is a number that varies. Line count is one.
The turn offset is a number that varies. The turn offset is zero.
The set number of turns is a number that varies. The set number of turns is five.
Table of Hunger Complaints
hunger
“It’s been a while since you ate last”
“Your stomach is starting to rumble”
“You’re really quite famished”
“You feel like you’re about to pass out from lack of nourishment”
Every turn when the remainder after dividing turn count by the set number of turns is the turn offset:
if the player is hungry begin;
choose row line count in the table of hunger complaints;
say “[hunger entry].[paragraph break]”;
if line count is less than the number of rows in the table of hunger complaints, increment line count;
end if.[/code]
I’ve got the same code for thirst rules and it works fine so far, but the two codes now conflict.
[code]A thing is either drinkable or undrinkable
Drink is a kind of thing. Drink is usually drinkable. Drink has a time called the satisfaction period. The satisfaction period of a drink is usually 2 minutes.
Thirsty is an action applying to one thing.
A person can be thirsty or sated. The player is thirsty.
Check drinking something:
if the noun is not drink, say “You can’t drink that!” instead.
Carry out drinking something:
now the player is replete;
thirst resumes in the satisfaction period of the noun from now.
At the time when thirst resumes:
dehydration occurs in 10 minutes from now;
now the turn offset is the remainder after dividing turn count by the set number of turns;
now line count is one;
now the player is thirsty.
At the time when dehydration occurs:
if the player is thirsty, end the game saying “You have died from dehydration.”
Line count is a number that varies. Line count is one.
The turn offset is a number that varies. The turn offset is zero.
The set number of turns is a number that varies. The set number of turns is five.
Table of Thirst Complaints
thirst
“It’s been a while since you drank something”
“Your mouth feels parched”
“You’re very thirsty”
“Your thirst is maddening, you simply must drink something soon”
Every turn when the remainder after dividing turn count by the set number of turns is the turn offset:
if the player is thirsty begin;
choose row line count in the table of thirst complaints;
say “[thirst entry].[paragraph break]”;
if line count is less than the number of rows in the table of thirst complaints, increment line count;
end if.[/code]
This snippet of code is repeated in both:
The set number of turns is a number that varies. The set number of turns is five.
I can’t create separate turn lengths for each rule section. Only works if they are both the same.
Also for both of them the complaints tables are sequential but they but they don’t go abcd, hunger goes a,c,d skipping the second complaint. And thirst goes b,d skipping the first and third complaints.