I tried what you and the other person suggested but it still does not work.
Here is the code.
I welcome any suggestions on getting this code to work.
A house is a room. "Inside the house is a machine".
the Well is south of the house. "To the north is an old wooden house."
A Wishing Well is in the Well. "An old brick wishing well."
A button is a thing.
A button can be on or off, a button is usually off.
A machine is in the house. "It has a red button."
A machine is a devide.
A button is on the machine. the description is "A red button is on the
machine".
X is a truth state variable.
X is false..
understand "switch" as pushing.
understand "on", "off" as button..
[ this is the code that is not working ]
[start of code]
Instead of Pushing the Button:
If X is false:
say "You switch on the machine";
now X is true;
otherwise:
say "You stop the machine";
now X is false;
end if.
[end of code]
Every turn when X is true:
say "[if the machine is visible]The machine rattles.";
[ i was experimenting. if I type 'switch on' it does not work. If I type
'switch on machine' then it works. ]
instead of switching on:
If X is false:
say "It's on";
now X is true.
instead of switching off:
now X is false;
say "It's off".
instead of switching on Wishing Well:
say "You can't do that, its not a machine".
----------------------------------------------------------------
This is the error message I got from Inform 7.
This is the report produced by Inform 7 (build 6G60) on its most recent run
through:
Problem. The rule or phrase definition 'Instead of Pushing the Button'
seems to use both ways of grouping phrases together into 'if', 'repeat' and
'while' blocks at once. Inform allows two alternative forms, but they
cannot be mixed in the same definition.
One way is to end the 'if', 'repeat' or 'while' phrases with a 'begin', and
then to match that with an 'end if' or similar. ('Otherwise' or 'otherwise
if' clauses are phrases like any other, and end with semicolons in this
case.) You use this begin/end form here, for instance - 'end if' .
The other way is to end with a colon ':' and then indent the subsequent
phrases underneath, using tabs. (Note that any 'otherwise' or 'otherwise
if' clauses also have to end with colons in this case.) You use this
indented form here - 'If X is false'
Regards Brian
--
Regards Brian