I’m trying to implement the full score scenario from the example “Bosch”. I have compiled and executed the example.
When I incorporate the same code from the example into my source, I get a compiler error on a line that compiles without error in a different context.
I’ve included the sample below for convenience. The compiler dies when dealing with this block of code with the error below:
[the say doesn't generate a compiler error, but the if current action does]
every turn:
say "current action: [current action]."
After doing something:
repeat through Table of Valuable Actions:
if the current action is the relevant action entry and turn stamp entry is less than 0:
now the turn stamp entry is the turn count;
increase the score by the point value entry;
continue the action.
Problem. In the sentence ‘if the current action is the relevant action entry and turn stamp entry is less than 0’ , I was expecting that ‘current action is the relevant action entry and turn stamp entry is less than 0’ would be a condition. It didn’t make sense as one long phrase, but because it was divided up by ‘and’/‘or’, I tried breaking it down into smaller conditions, but that didn’t work either. ‘current action is the relevant action entry’ did not make sense; ‘turn stamp entry is less than 0’ was okay; so I ran out of ideas.
I was trying to match this phrase:
if (current action is the relevant action entry and turn stamp entry is less than 0 - a condition):
But I didn’t recognise ‘current action is the relevant action entry and turn stamp entry is less than 0’.
Use scoring.
The Garden of Excess is a room. The gilded lily is an edible thing in the Garden of Excess.
The Pathway to Desire is west of the Garden of Excess. The emerald leaf is in the Pathway.
Table of Valuable Actions
relevant action description point value turn stamp
taking the emerald leaf "Emerald Leaf" 15 -1
eating the gilded lily "Gilded Lily" 5 -1
The maximum score is 25.
After doing something:
repeat through Table of Valuable Actions:
if the current action is the relevant action entry and turn stamp entry is less than 0:
now the turn stamp entry is the turn count;
increase the score by the point value entry;
continue the action.
Understand "full score" or "full" as requesting the complete score. Requesting the complete score is an action out of world.
Check requesting the complete score:
if the score is 0, say "You have not yet achieved anything of note." instead.
Carry out requesting the complete score:
say "So far you have received points for the following: [line break]";
sort the Table of Valuable Actions in turn stamp order;
repeat through the Table of Valuable Actions:
if the turn stamp entry is greater than 0:
say "[line break] [description entry]: [point value entry] points";
say line break.
Test me with "eat lily / w / full score / get leaf / full".