Inform 7 Home Page / Documentation
§18.12. Printing a number 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 prints the "five gold rings" part. The variable "listing group size" contains the number, which in this example would be 5, and is always at least 2.
2. The default behaviour. The number of items is printed, in words ("five") and then the "printing the plural name" activity is run ("gold rings").
3. Examples. (a) Using this activity is for perfectionists, because the normal behaviour is almost always fine. Still:
Rule for printing a number of blocks when the listing group size is 3: say "all three blocks".
(b) Or perhaps:
Rule for printing a number of ants: say "altogether [listing group size in words] ants".
(c) If the only part needing variation is the plural name, it's simpler and tidier to use the "printing the plural name of something" activity instead.
|Start of Chapter 18: Activities|
|Back to §18.11. Printing the plural name of something|
|Onward to §18.13. Listing contents of something|
Room descriptions often make the player character out to be a bit of a savant, able to count whole stacks of items at a glance: "You see 27 paper clips here."
We can adjust this behavior to our liking, though, with the printing a number... activity, as follows:
The Editor's Office is a room. The desk is a supporter in the Editor's Office.
A red pencil is a kind of thing. 12 red pencils are on the desk.
A letter is a kind of thing. 12 letters are on the desk. Understand "correspondence" as a letter.
Rule for printing the plural name of a letter:
if the listing group size is greater than 7, say "correspondence";
otherwise say "letters".
Rule for printing a number of something (called the target) when the listing group size is greater than 7:
say "[one of]some [or]various [or]an assortment of [at random]";
carry out the printing the plural name activity with the target.
This general rule can of course be overridden by more specific ones; for instance, if we want to take the opportunity to comment on the viewpoint character's appetite for instruments of correction:
Rule for printing a number of red pencils (called the target) when the listing group size is greater than 10:
carry out the printing the plural name activity with the target;
say " in nearly-sufficient quantity".
Test me with "get two letters / look / get a pencil / i / get pencil / g / g / look / i / get all / i".