For now I’m going with things that have non-unique names, instead of meddling with kinds. But I’ve run into another snag:
[spoiler][code]Graveyard is a room.
A monster is a kind of person. Understand “monster” as a monster.
A zombie is a kind of monster.
A skeleton is a kind of monster.
There are four zombies in graveyard.
There are two skeletons in graveyard.
Ordinal is a kind of value. The ordinals are unordered, first, second, third, fourth.
A thing has an ordinal called order. Understand the order property as describing a thing.
Definition: a thing is unique rather than non-specific if it is a last named item listed in Table of Non-Specific Names and the order of it is first.
Before printing the name of a non-specific thing:
say "[order] "
After reading a command:
repeat through Table of Non-Specific Names:
say “deleting row [non-specific name entry]/[last named item entry].”;
blank out the whole row;
repeat with candidate running through things in the location:
unless we updated a non-specific name row for candidate:
say “creating row from [printed name of candidate].”;
now the order of candidate is first;
Choose a blank row in Table of Non-Specific Names;
now the non-specific name entry is the printed name of candidate;
now the last named item entry is candidate;
To decide whether we updated a non-specific name row for (candidate - an object):
Repeat through Table of Non-Specific Names:
say “entry: [non-specific name entry] printed name: [printed name of candidate].”;
if non-specific name entry is the printed name of candidate:
say “found row matching [printed name of candidate].”;
now the order of candidate is the ordinal after the order of the last named item entry;
now the last named item entry is candidate;
decide yes;
decide no;
Table of Non-Specific Names
non-specific name last named item
a text an object
with 20 blank rows
Check an actor attacking something that is not a monster (this is the only attack monsters rule):
stop the action with library message attacking action number 1 for the noun.
The only attack monsters rule is listed instead of the block attacking rule in the check attacking rulebook.
Report attacking something:
Say “You hit [the noun] with a mighty blow!”
test me with “attack monster/first/zombie”
[/code][/spoiler]
Since “listed in” wasn’t working, I tried manually looping over the Table of Non-Specific Names. But as the debugging statements show, the printed name never matches the non-specific name entry at all. As far as I can tell, they’re both texts, and they’re sometimes the same, and yet the code to update the row instead of creating a new one never runs. What am I doing wrong?