Every turn:
choose a random row in Table of Ingrid's Routine;
if Ingrid is visible:
say "[do entry]".
Table of Ingrid's Routine
do
"[do cleaning]"
"[do laundry]"
to say do cleaning:
say "Ingrid cleans a table.";
now the table is clean.
to say do laundry:
say "Ingrid fills the washing machine";
move clothes to washing machine.
Any suggestions for how to improve this, so that I can use the [To do
cleaning:] construct in place of [To say do cleaning:].
Take a look at chapter 21.3, "Phrases as values". You can create a
table column whose type is "phrase nothing -> nothing", and then
"apply" a value from that column.
--Z
--
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*
Every turn:
choose row 2 in Table of Ingrid's Routine;
if Ingrid is visible:
apply does entry;
continue the action.
Table of Ingrid's Routine
activities do does
value value a phrase nothing -> nothing
"Ingrid is cleaning" "[do cleaning]" booyah
to booyah (this is booyah):
say "Thanks Andrew! This is cool."
Just to take advantage of the presence of this thread to ask about
something that I've been trying to do: Is there any way to do
something similar with descriptions? I've tried storing a description
of objects in both tables and lists, but Inform refuses to compile,
with the message that indicates that this kind of value cannot be
stored in a table.
Basically, I want to use the table to store a description of things
that should be iterated over--rooms, visible things, touchable things,
etc--and then execute that description elsewhere.
--Erik