Inform 7 Home Page / Documentation
§18.11. Printing the plural name of something
1. When it happens. Only when a group of identical items is present in the same place, and are being described jointly with text like "You can see five gold rings here." The activity happens after "five" and before "here." (See the activity "printing a number of something" if the whole phrase needs to be altered.)
2. The default behaviour. The plural name - in this case "gold rings" - is printed out.
3. Examples. (a) Suppose we want to emphasise how nice it is to have more than one gold ring:
Rule for printing the plural name of a gold ring: say "gleaming gold rings".
(b) If the number needs changing as well, it's necessary to use the "printing a number of something" activity instead.
|Start of Chapter 18: Activities|
|Back to §18.10. Printing the name of something|
|Onward to §18.12. Printing a number of something|
In this scenario, the player starts with a bag full of unsorted letters. These can be polite or rude, but he won't know which until he has examined them. What's more, he is allowed to sort the letters, in which case a group of letters will be shown as (for instance) "two polite letters"; but a group of mixed letters, even if they have all been read, will be called "unsorted letters".
Further, the player should be allowed to refer to sorted letters by tone, but not unsorted letters.
To do this, we'll need printing the name... and printing the plural name..., as well as some special understanding rules.
Before printing the plural name of a letter (called the subject):
if the subject is grouped:
say "[tone] ";
otherwise if the number of unread letters which are next to the subject is 0:
say "unsorted ".
After printing the plural name of a letter (called the subject):
if the number of read letters which are next to the subject is 0, say " (all unread, at the moment)" instead;
if the number of unread letters which are next to the subject is greater than 0, say " (some as yet unread)" instead.
Definition: a letter is grouped:
if it is unread, no;
if the number of unread letters next to it is greater than 0, no;
repeat with item running through letters which are next to it:
if the tone of item is not the tone of it, no;
Now, there's a good bit of interaction to streamline. We intend that the player will be taking letters from the satchel, reading them, and putting them (perhaps grouped) into boxes. Our interaction rules should assist in this process as much as possible. To start with, the player will be most likely to examine letters he hasn't read yet:
The rules about taking are more subtle: the player is more likely to want to take an ungrouped letter than a grouped one; he is more likely to want one from the satchel than not; and he is most unlikely to want to take a letter (grouped or ungrouped) that he is already holding.
And finally, we will assume by default that anything other than examining or taking is most likely to apply to a letter he's already identified:
And we would also like to understand properties under the same circumstances as printing -- a letter will be identifiable as "polite" if it's already been read and it is either by itself or in a sorted stack of polite letters, but otherwise not. What's more, to make it possible to disambiguate commands in the other direction, we'll call any unsorted letter "random", to represent that the player doesn't know what it is.
Test me with "inventory / examine letter / get letter / i / put letter in ceo box / inventory / get letter / x letter / g / g / i / x letter / g / g / i / put letter in hold box / get letter / g / g / i".
That last "repeat" is merely a device to shuffle the order of items in the satchel so that the player will not always encounter the letters in a neatly presorted order, despite our defining them that way. (Of course, that means that the test produced by TEST ME cannot be very exciting...)