Re: Inform: "plural" feature.. a problem


14 Oct 1995 17:05:46 GMT

"Sam Hulick" <shulick@raisin.ucs.indiana.edu> wrote:
> If you light one, and its name becomes "a burnt match", and you drop it
> back in the pile of matches, it's just:
>
> You see nine matches here.
>
> But it SHOULD say:
>
> You see eight matches, and a burnt match.

Take a look at page 56 of the Inform manual. The library uses the
`name' property of the objects to see which ones are indistinguishable,
and so should be listed together. You need something like this
(assuming that matches get the `burned' attribute when they are burned):

parse_name [ n w ok;
if (parser_action == ##The_Same) {
if ((parser_one has burned && parser_two has burned) ||
(parser_one hasnt burned && parser_two hasnt burned))
return -1;
else
return -2;
}
do {
w = NextWord(); ok = 0;
if (w == 'match' || (w == 'burned' && self has burned)) {
n ++; ok = 1;
}
} until (ok == 0);
return n;
],

--
Gareth Rees