Hudsucker Industries
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.
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".
Usually a thrumming hive of bee-like workers, but you got in early to get a jump on the day's work.
Before you is a wall of mailboxes, including a CEO box, a Hold box and a Trash box.
>(Testing.)
>[1] inventory
You are carrying:
a satchel
seven letters (all unread, at the moment)
>[2] examine letter
On inspection, it turns out to be quite polite.
>[3] get letter
Taken.
>[4] i
You are carrying:
a polite letter
a satchel
six letters (all unread, at the moment)
>[5] put letter in ceo box
(the polite letter in the CEO box)
You put the polite letter into the CEO box.
>[6] inventory
You are carrying:
a satchel
six letters (all unread, at the moment)
>[7] get letter
(the random letter)
Taken.
>[8] x letter
(the random letter)
On inspection, it turns out to be quite flamingly rude.
>[9] g
(the random letter)
On inspection, it turns out to be quite polite.
>[10] g
(the random letter)
On inspection, it turns out to be quite flamingly rude.
>[11] i
You are carrying:
a flamingly rude letter
a satchel
five letters (some as yet unread)
>[12] x letter
(the random letter)
On inspection, it turns out to be quite polite.
>[13] g
(the random letter)
On inspection, it turns out to be quite polite.
>[14] g
(the random letter)
On inspection, it turns out to be quite polite.
>[15] i
You are carrying:
a flamingly rude letter
a satchel
five unsorted letters
>[16] put letter in hold box
(the flamingly rude letter in the Hold box)
You put the flamingly rude letter into the Hold box.
>[17] get letter
(the polite random letter)
Taken.
>[18] g
(the flamingly rude random letter)
Taken.
>[19] g
(the polite letter)
Taken.
>[20] i
You are carrying:
three unsorted letters
a satchel
two polite letters
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…)