Counterfeit Monkey — 200 of 292

Emily Short

Release 5

Book 3 - Tools

Chapter 1 - The Letter-Remover

Section 1 - Normal Behavior

Definition: a thing is irretrievable:

if it is the player:

no;

if it encloses the player:

no; [because we've got a different disaster lined up to deal with this.]

if it is the letter-remover:

yes;

if it is the tub:

yes;

if it encloses the letter-remover:

yes;

if it encloses the tub:

yes;

no.

Check waving the letter-remover at something irretrievable:

if the second noun contains the tub:

try taking the tub;

if the second noun contains the letter-remover:

try taking the letter-remover;

if the second noun is irretrievable:

say "Since [the second noun] contain[s] [if the second noun encloses the tub][the tub][otherwise]something useful[end if], it might be a bad idea to change its form. [You] might not be able to get the contents back." instead.

Instead of waving the letter-remover device:

say "Whoa, whoa! Just waving that thing around without an exact aim could do a lot of damage. Wave it AT something, or don't wave it at all."

The letter-remover device is a thing. It is essential. Understand "letter remover" or "plastic device" or "device" or "blunt-nosed" as letter-remover.

The description of the letter-remover device is "It is a blunt-nosed plastic device, about the size of a laser pointer, that can be waved at things to remove excess [current setting in upper case]s. It is not very powerful, and often fails against large items. On the other hand, it has a wide range of action: it can be set to any letter [you] choose."

The introduction is "These are, if not exactly cheap, hardly unknown in Atlantis."

Understand "remover" as the letter-remover device.

The printed name of the letter-remover device is "[current setting in upper case]-remover". The indefinite article of the letter-remover device is "your".

After printing the name of the letter-remover device while taking inventory:

if the letter-remover device is upgraded:

if the letter-remover device is creature-enabled:

say " (upgraded to handle animates and abstracts)";

otherwise:

say " (upgraded to handle abstracts)";

otherwise if the letter-remover device is creature-enabled:

say " (upgraded to handle animates)".

The letter-remover device has some indexed text called current setting. The current setting of the letter-remover device is "r".

To say a-an (item - letter-remover device):

if the current setting of the letter-remover device is listed in the vowel-starting list:

say "an";

otherwise:

say "a";

say " [letter-remover device]";

The vowel-starting list is a list of indexed texts that varies. The vowel-starting list is { "a", "e", "f", "h", "i", "l", "m", "n", "o", "r", "s", "x" }.

A small knob is part of the letter-remover device. Understand "dial" as the small knob when the lock is not visible. The description is "It is very delicately made and stamped with letters around the circumference. The currently up-facing letter is [the current setting of the letter-remover device]."

After printing the name of the small knob:

say " on your [letter-remover]".

Before doing something to the small knob:

change the noun to the letter-remover device;

try the current action instead.

Understand "[letter-remover] [something]" as waving it at.

After reading a command:

say "[run paragraph on]";

let N be indexed text;

let N be the player's command;

replace the regular expression " [current setting of the letter-remover]-remover" in N with " letter-remover";

change the text of the player's command to N;

say "[run paragraph on]";

After reading a command when the player can touch the letter-remover:

let N be indexed text;

let N be the player's command;

if N matches the regular expression ".-remover":

if N matches the regular expression "(.*) (.)-remover (.)*":

replace the regular expression "(.*) (.)-remover (.)*" in N with "\2";

otherwise if N matches the regular expression "(.*) (.)-remover":

replace the regular expression "(.*) (.)-remover" in N with "\2";

otherwise:

replace the regular expression "(.)-remover.*" in N with "\1";

if the current setting of the letter-remover exactly matches the text "[N]":

make no decision;

if the number of characters in N is greater than 1:

make no decision;

change N to "[N in lower case]";

unless N matches the regular expression "\l":

say "Only the 26 letters of the English alphabet are available to the letter-remover.";

reject the player's command;

change the current setting of the letter-remover to "[N]";

now the letter-remover is changing;

otherwise:

say "[run paragraph on]";

The letter-remover can be static or changing. The letter-remover is static.

Sanity-check doing something when the noun is the letter-remover and the letter-remover is changing:

now the letter-remover is static;

if the player does not carry the letter-remover:

silently try taking the letter-remover;

if the player does not carry the letter-remover:

stop the action;

say "[one of][You] smoothly, and almost without thinking about it, reset your device to be [a-an letter-remover][or][You] run our thumb over the dial, setting the device to [a-an letter-remover][or][You] reset the device to [current setting of letter-remover][stopping]. [run paragraph on]";

Understand "set [something]" as vaguely setting. Vaguely setting is an action applying to one thing.

Check vaguely setting:

say "That is insufficiently exact [--] [you][']d have to set [the noun] to something." instead.

Instead of vaguely setting the letter-remover:

say "You have to set it to a specific letter, as in SET [letter-remover] TO X."

Understand "set [letter-remover device] to [text]" or "tune [letter-remover device] to [text]" or "turn [letter-remover device] to [text]" as tuning it to. [Understand "set [something] to [text]" as tuning it to.] Tuning it to is an action applying to one carried thing and one topic.

Check tuning it to:

if the noun is not the letter-remover device, say "[The noun] cannot be tuned." instead.

Check tuning it to:

let N be indexed text;

let N be the topic understood;

if the number of characters in N is greater than 1:

say "[You] can only tune the letter-remover device to one letter at a time." instead;

change N to "[N in lower case]";

unless N matches the regular expression "\l":

say "Only the 26 letters of the English alphabet are available to the letter-remover." instead.

Carry out tuning it to:

change the current setting of the letter-remover device to the topic understood.

Report tuning it to:

say "You flick our thumb over the small knob: [you] now have [a-an letter-remover device]."

Report tuning the letter-remover to something for the third time:

say "[first custom style][bracket]You can also tune the device just by using another name for it: referring to the device as, for instance, an N-remover will automatically set it to n.[close bracket][roman type][paragraph break]"

Understand "remove [text] from [something]" or "letter-remove [text] from [something]" as letter-removing it from. Letter-removing it from is an action applying to one topic and one thing.

Carry out letter-removing the topic understood from something:

try tuning the letter-remover to the topic understood;

try waving the letter-remover at the second noun.

Understand "wave [something preferably held] at/toward/over/around/on/across [something]" as waving it at. Waving it at is an action applying to one carried thing and one visible thing.

Understand "use [letter-remover] on [something]" as waving it at. Understand "point [letter-remover] at [something]" as waving it at.

Understand "wave [something preferably held] at/toward/over/around [any locally-present room]" as waving it at.

Understand "use [letter-remover] on [any locally-present room]" as waving it at. Understand "point [letter-remover] at [any locally-present room]" as waving it at.

Check waving something at something:

if the noun is not a letter-remover device,

say "Nothing interesting happens." instead.

Check waving something at a room:

if the noun is not a letter-remover device,

say "Nothing interesting happens." instead;

say "If we were to succeed in transforming the entire room — mercifully, that's unlikely, given the power requirements — but if we did succeed, you and I would be rendered inanimate, along with any other hapless passers-by." instead.

Check waving the letter-remover device at the letter-remover device:

say "This is physically impossible as well as pointless." instead.

[Check waving the letter-remover device at something which encloses the player:

say "A safety override prevents [the letter-remover] from working on objects which actually contain the operator at the time."]

The letter-remover device can be upgraded. The letter-remover device is not upgraded.

The letter-remover device can be creature-enabled. The letter-remover device is not creature-enabled.

The waving it at action has an object called the generated object (matched as "creating").

The waving it at action has a truth state called the letter absence.

Setting action variables for waving the letter-remover device at an object which is not the letter-remover device:

if the second noun is a direction:

make no decision;

change the letter absence to false;

let Y be the letter-hash of the current setting;

let comparison number be the hash code of the second noun with Y removed;

if comparison number is the hash code of the second noun:

now letter absence is true;

otherwise:

let starting text be indexed text;

let starting text be "[printed name of the second noun]";

let starting text be "[starting text in lower case]";

replace the regular expression "[current setting]" in the starting text with "";

change generated object to the letter-remover device;

repeat with item running through things in repository:

if comparison number is the hash code of the item:

let goal text be indexed text;

let goal text be "[printed name of the item]";

let goal text be "[goal text in lower case]";

if the goal text is the starting text:

change the generated object to the item;

break;

if the generated object is the letter-remover device:

change the disappointment text to the starting text.

The disappointment text is some indexed text that varies.

[Check waving the letter-remover at a foreign-tongued thing:

say "[The letter-remover] squeaks as though frightened[one of]. Apparently encountering objects that aren't in English generates its own alarm tone[or] by the foreign-language [second noun][stopping]." instead. ]

Check waving the letter-remover at a direction:

say "'[The second noun]' is a concept, not a concrete thing, and it eludes letter-removers." instead.

Check waving the letter-remover at something:

if the letter absence is true:

say "The letter-remover finds no [current setting of the letter-remover] in [the second noun]." instead.

Check waving the letter-remover at something which is enclosed by the player:

if the player wears the second noun:

try taking off the second noun;

if the player does not carry the second noun:

say "Altering one's clothes while they're on can have some unfortunate side effects." instead;

if the player does not carry the second noun:

try taking the second noun;

if the player does not carry the second noun:

let enclosure be the holder of the second noun;

say "It isn't a good idea to change objects while they're [if the enclosure is a container]in[otherwise]on[end if] [the enclosure]." instead.

Check waving the letter-remover at something creating the letter-remover:

if the disappointment text matches the regular expression ".*\s.*":

let presumed second noun be indexed text;

let presumed second noun be "[second noun]";

let C be the number of words in presumed second noun;

let presumed second noun be "[word number C in presumed second noun]";

change the prior named noun to the second noun;

say "The device buzzes, puzzled. It has tried to create a '[disappointment text]': evidently '[presumed second noun]' [is-are] too tightly bound to [its-their] modifiers and can't be manipulated separately[one of]. This is a serious problem in my field of study, incidentally[or][stopping][if the second noun is fixed in place or the second noun is scenery]. Or perhaps it just doesn't have sufficient power to handle [the second noun][end if]." instead;

otherwise:

if disappointment text is "":

say "The device emits a distinctive triple tone, which means that the requested action would have entirely destroyed the target object. There are safety overrides to prevent it doing such a thing." instead;

otherwise:

say "The device buzzes, puzzled. It is unable to create anything recognizable called '[disappointment text]'[if the second noun is fixed in place or the second noun is scenery], or perhaps it just doesn't have sufficient power to handle [the second noun][end if]." instead.

Check waving the letter-remover at something creating a crude thing:

say "A safety override mechanism kicks into play before the operation is complete; the device plays a short snickering noise. Evidently its one joy in life is detecting and foiling practical jokes." instead;

Check waving the letter-remover at something creating a person when the letter-remover device is not creature-enabled:

say "[The second noun] flickers and there is a brief image of [a generated object] in [its-their of the second noun] place, but a legal override kicks in: [a-an letter-remover] is hardware-crippled to prevent generating any living creature." instead;

Check waving the letter-remover at something creating an r-abstract thing when the letter-remover device is not upgraded:

say "[The second noun] flickers and there is a brief image of [a generated object] in [its-their of the second noun] place [--] the concept strangely embodied in a physical form [--] before the power gives out[one of]. I guess your device there just isn't tuned to reify abstracts[stopping]." instead;

Check waving the letter-remover device at something (this is the checking for danger rule):

abide by the dangerous destruction rules for the second noun;

[abide by the dangerous construction rules for the generated object.]

Check waving the letter-remover at a room creating the letter-remover:

say "[The letter-remover] is powerless to make [the second noun] into anything called '[disappointment text]', but perhaps this is to be expected considering the size of the target. The device is after all a mere portable device with limited resources."

Check waving the letter-remover at a room creating something which is not the letter-remover:

abide by the dangerous destruction rules for the second noun;

[abide by the dangerous construction rules for the generated object.]

Carry out waving the letter-remover device at something:

move the generated object to the holder of the second noun;

if the second noun is part of the holder of the second noun:

now the generated object is in the location;

move the second noun to the repository;

if the generated object proffers the second noun and the generated object is not original: [we've managed to create a loop in the generation, as in lee+ass, leases, lass, ass]

now every thing which proffers the second noun proffers the generated object;

now the generated object does not proffer the generated object;

otherwise:

now the generated object is not proffered by anything;

now every thing which proffers the second noun proffers the generated object;

if an essential thing (called source) proffers the generated object:

now the generated object is essential;

[if something (called source) which encloses an essential thing proffers the generated object:

now the generated object is essential; ]

[so that 'take it' or whatever will work, after we've made something: ]

have the parser notice the generated object;

record "using the letter-remover" as achieved;

let current be the current setting of the letter-remover;

remove current from the list of remaining letters, if present;

if the number of entries in the list of remaining letters is 0:

record "Admiral Thoureaux award for removing every letter of the alphabet in one playthrough" as an achievement;

[add the current setting of the letter-remover to the list of removed letters, if absent. ]

The list of remaining letters is a list of indexed text that varies. The list of remaining letters is { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}.

Report waving the letter-remover device at something:

if the scent-description of the generated object is not "":

say "With a distinct whiff of [the scent-description of the generated object], [the second noun] turn[s] into [a generated object]. [run paragraph on]";

otherwise:

say "There is [one of]a flash of psychedelic col[our]s[or]a mad-scientist cackle[or]a [pastel-color] cloud[or]a flash of [primary-color] light[or]a smell of anise[or]a distinct spearmint flavor[at random], and [the second noun] turn[s] into [a generated object]. [run paragraph on]";

abide by the dangerous construction rules for the generated object;

try examining the generated object instead.

Report waving the letter-remover device at something creating a seen thing:

say "[The second noun] give[s] way to the now-familiar [generated object].";

abide by the dangerous construction rules for the generated object instead.