Can't get "Walls and Noses" examples to run

I am trying to run the “Walls and Noses” example: inform7.com/learn/man/ex414.html but no joy :frowning:

Here’s what I’m putting in inform7 (on OSX) copied and pasted from that webpage:

[code]“Walls and Noses”
Eight-Walled Chamber is a room. “A perfectly octagonal room whose walls are tinted in various hues.”
Understand “wall” as a direction.
Definition: a direction is matched if it fits the parse list.
Definition: a room is matched if it fits the parse list.
Definition: a thing is matched if it fits the parse list.
Rule for asking which do you mean when everything matched is direction: say “In which direction?”

To decide whether (N - an object) fits the parse list:
(- (FindInParseList({N})) -)
Include (-
[ FindInParseList obj i k marker;
marker = 0;
for (i=1 : i<=number_of_classes : i++) {
while (((match_classes–>marker) ~= i) && ((match_classes–>marker) ~= -i)) marker++;
k = match_list–>marker;
if (k==obj) rtrue;
}
rfalse;
];
-)

Include Complex Listing by Emily Short.
Wilma, Betty, and Frederica are women in the Eight-Walled Chamber. Understand “lady” or “woman” as a woman. A nose is a kind of thing. A nose is part of every person.
Rule for asking which do you mean when everything matched is a nose:
prepare a list of matched things;
if your nose is an output listed in the Table of Scored Listing:
choose row with an output of your nose in the Table of Scored Listing;
now the assigned score entry is -1;
say “Whose nose do you mean, [the prepared list delimited in disjunctive style]?”
Rule for printing the name of a nose (called target) while asking which do you mean :
if everything matched is a nose:
if the target is part of a person (called owner):
if the owner is the player, say “your own”;
otherwise say “[the owner][apostrophe]s”;
otherwise:
make no decision.
Understand “own” or “mine” as your nose.
Test me with “x wall / north / x nose / mine”.[/code]

Also at: gist.github.com/4060057

I’m getting this error message:

I’ve tried replacing all spaces with tabs, but no luck - I’m sure I’m doing something simple and obvious wrong - can anyone spot it?

BTW, what I really want to work out how to do is to catch the disambiguating “which do you mean” when looking at a person with a nose, and automatically describe both them and their nose rather than asking the player to mak a choice, e.g. something like:

Instead of asking which do you mean while looking [something]: describe [something] and all its parts.

Many thanks in advance

Open the example in the IDE and click on the blue square icon right where the example code starts. It will copy the code with the correct amount of tabs in the right places.

(For the record, you have one too many tabs in each of the last three rows of the last rule.)

Try this.

[spoiler][code]“Walls and Noses”

Eight-Walled Chamber is a room. The description of the eight-walled chamber is “A perfectly octagonal room whose walls are tinted in various hues.”.

Understand “wall” as a direction.

Definition: a direction is matched if it fits the parse list.
Definition: a room is matched if it fits the parse list.
Definition: a thing is matched if it fits the parse list.

Rule for asking which do you mean when everything matched is direction:
say “In which direction?”.

[Checking the parse list requires a bit of behind-the-scenes work with Inform 6. Fortunately, you don’t have to understand this entirely in order to use the rest of the example:]

To decide whether (N - an object) fits the parse list:
(- (FindInParseList({N})) -)

Include (-
[ FindInParseList obj i k marker;
marker = 0;
for (i=1 : i<=number_of_classes : i++) {
while (((match_classes–>marker) ~= i) && ((match_classes–>marker) ~= -i)) marker++;
k = match_list–>marker;
if (k==obj) rtrue;
}
rfalse;
];
-)

[Now that we’ve defined our “matched” adjective, we can use it for other purposes as well – even generating our own lists. Our second challenge was to respond to EXAMINE NOSE with “Whose nose do you mean, Frederica’s, Betty’s, Wilma’s or your own?”]

[Here we need to change the way the question is worded (not “which do you mean” but “whose nose do you mean”). We also have to the names of the noses as they’re printed in this particular context, so that they don’t repeat the word “nose” over and over. And – as a point of good English style – we also want “your own” nose always to be last on the list.]

[For this purpose we may want to use the built-in “Complex Listing” extension, which allows us to print specially ordered lists. So:]

Include Complex Listing by Emily Short.

Wilma, Betty, and Frederica are women in the Eight-Walled Chamber. Understand “lady” or “woman” as a woman. A nose is a kind of thing. A nose is part of every person.

Rule for asking which do you mean when everything matched is a nose:
prepare a list of matched things;
if your nose is an output listed in the Table of Scored Listing begin;
choose row with an output of your nose in the Table of Scored Listing;
now the assigned score entry is -1;
end if;
say “Whose nose do you mean, [the prepared list delimited in disjunctive style]?”.

Rule for printing the name of a nose (called target) while asking which do you mean :
if everything matched is a nose begin;
if the target is part of a person (called owner) begin;
if the owner is the player begin;
say “your own”;
otherwise;
say “[the owner][apostrophe]s”;
end if;
end if;
otherwise;
make no decision;
end if.

Understand “own” or “mine” as your nose.

Test me with “x wall / north / x nose / mine”.[/code][/spoiler]

This is one of the reasons why I dislike colon indentation syntax.

Hope this helps.

thank guys, that’s very helpful. Really appreciate you taking the time to point that out :slight_smile:

Now I just need to work out if I can use this to allow looking at a person with body parts to list the description of all parts rather than asking which part to look at …

Strangely this code works as part of the example:

Rule for asking which do you mean when everything matched is a nose: prepare a list of matched things; if your nose is an output listed in the Table of Scored Listing: choose row with an output of your nose in the Table of Scored Listing; now the assigned score entry is -1; say "Whose nose do you mean, [the prepared list delimited in disjunctive style]?"

but I can’t get even a very simplified version to work in my own code:

Rule for asking which do you mean when everything matched is a nose: say "I see all the body parts of this person"

I’ve tried including various supporting code such

[code]To decide whether (N - an object) fits the parse list:
(- (FindInParseList({N})) -)

Include (-
[ FindInParseList obj i k marker;
marker = 0;
for (i=1 : i<=number_of_classes : i++) {
while (((match_classes–>marker) ~= i) && ((match_classes–>marker) ~= -i)) marker++;
k = match_list–>marker;
if (k==obj) rtrue;
}
rfalse;
];
-)

Include Complex Listing by Emily Short.

Wilma, Betty, and Frederica are women in the Basement. Understand “lady” or “woman” as a woman. A nose is a kind of thing. A nose is part of every person.[/code]

but I keep getting this problem:

I’ve read the section on “while” clauses several times, but still can’t work out what I’m doing wrong - any tips?

Many thanks in advance

You need the definition of what “matched” means.

Definition: a direction is matched if it fits the parse list. Definition: a room is matched if it fits the parse list. Definition: a thing is matched if it fits the parse list.