I’ve been looking at this in the documentation and here but I can’t find it.
I have a bunch of objects that have a number associated to them. I want to make a list of everything that has a ‘1’ as its number. Here’s the code; all of the attempts to make a list at the bottom fail to compile.
Playroom is a room.
A thing has a number called the secret-number.
The ball is a thing. The secret-number of the ball is 1.
The block is a thing. The secret-number of the block is 1.
The string is a thing. The secret-number of the string is 2.
When play begins:
say "You can see [a list of things with secret-number 1]";
say "You can see [a list of things with a secret-number of 1]";
say "You can see [a list of things which have secret-number equal to 1]";
say "You can see [a list of secret-number 1 things]";
This is one of the harder-to-find Inform tricks, I’m afraid.
A thing has a number called the secret-number.
The verb to secretly-number means the secret-number property.
The ball is a thing. The secret-number of the ball is 1.
The block is a thing. The secret-number of the block is 1.
The string is a thing. The secret-number of the string is 2.
When play begins:
say "You can see [a list of things which secretly-number 1].";
And if the number isn’t a property, but is e.g. something calculated by a phrase, you can make a new relation:
To decide what number is the (item - a thing) hashed:
decide on the number of letters in "[item]".
Hashing relates a thing (called X) to a number (called Y) when X hashed is Y.
The verb to hash to means the hashing relation.
When play begins: say the list of things that hash to 5.