Counterfeit Monkey — 205 of 292

Emily Short

Release 6

Section 2 - Spinning Functionality

Every turn when the location is Roget Close and something is on the spinner:

if not looking:

follow the spinner-turning rule;

say paragraph break.

This is the spinner-turning rule:

let the chosen article be a random thing on the spinner;

let X be the chosen article;

let the goal text be indexed text;

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

change goal text to "[goal text in lower case]";

let max characters be the number of characters in the goal text;

let substitute text be indexed text;

repeat with Z running from 1 to max characters:

change substitute text to "[character number Z in goal text][substitute text]";

change goal text to substitute text;

[ say "[substitute text]";]

[since the spinner's likely to be undoing its own work, allow it to get the original back.]

if the chosen article is proffered by something (called the source) which is not the chosen article:

if the hash code of the source is the hash code of X:

let item text be indexed text;

now item text is "[source]";

now item text is "[item text in lower case]";

if the goal text is item text:

now the chosen article is the source;

if the chosen article is X:

repeat with item running through things in the repository:

if the hash code of the item is the hash code of X:

let item text be indexed text;

now item text is "[item]";

now item text is "[item text in lower case]";

if the goal text is item text:

now the chosen article is the item;

if the chosen article is not X:

abide by the dangerous destruction rules for X;

now the chosen article is not proffered by anything;

now everything which proffers X proffers the chosen article;

if an essential thing (called source) proffers the chosen article:

now the chosen article is essential;

[ if something (called source) which proffers the chosen article encloses an essential thing:

now the chosen article is essential; ]

now everything which is on the spinner is in the repository;

move the chosen article to the spinner;

say "[if looking]After the mirror does its work,[otherwise]The mirror rotates in leisurely fashion, and when it is done[end if] there [is-are a list of things on the spinner].";

try examining the chosen article;

record "using the spinner" as achieved;

if the spinner-gate is closed:

now the spinner-gate is open;

now the spinner-gate is unlocked;

say "The gate clicks open. ";

abide by the dangerous construction rules for the chosen article;

have the parser notice the chosen article;

otherwise:

if looking:

if exactly one thing is on the spinner, say "It does";

otherwise say "[The list of things on the spinner] do[es]";

say " not change, however. ";

otherwise:

say "The mirror revolves for a moment, [one of]without effect[or]without changing [the list of things on the spinner][at random], though the word '[substitute text]' appears in startling green on the mirror's surface. ".

Test yambug with "tutorial off / wear monocle / buy yam / n / w / put yam on pedestal / z / x yam" holding the roll of bills and the monocle in Hesychius Street.

Rule for disclosing exterior of something (called special-target) which is on the spinner:

say "[The special-target] [is-are] slowly revolving on [a spinner][if a mentionable thing is on the spinner], together with [a list of mentionable things which are on the spinner][end if]. [run paragraph on]";

follow the spinner-turning rule.

Rule for disclosing contents of the spinner (this is the spinner-content rule):

say "On [the spinner], [a list of things on the spinner] revolve[s] idly. [run paragraph on]";

follow the spinner-turning rule.

Test spin-plans with "tutorial off / wave l-remover at plans / put pans on spinner / get snap / i / wave s-remover at snap / i / put nap on spinner / get pan / i / n" holding the secret-plans in Roget Close.

Test spinner with "tutorial off / look / z / get all / put remover on spinner / z / get remover / put god on spinner / get dog / put leer on spinner / look / z / get reel / g / n / test projecting" holding the leer in Roget Close.

Test projecting with "put reel in projector / turn projector on" in the Projection Booth.