Chapter 16 - The Cryptolock aka Vowel Rotator
[ The cryptolock is a variation on the idea of the spinner introduced much earlier in the game.
The puzzle here is completely different depending on whether you're playing hard mode or easy mode.]
The cryptolock is a scenery container in the Generator Room. It is fixed in place. The printed name of the cryptolock is "brushed steel bucket". Understand "brushed" or "steel" or "container" or "bucket" as the cryptolock.
The cryptoswitch is a device. The cryptoswitch is part of the cryptolock. The printed name of the cryptoswitch is "reverse switch". Understand "reverse" or "switch" as the cryptoswitch.
Report switching on the cryptoswitch:
say "The switch thunks over into the Reverse position." instead.
The description of the cryptolock is "Attached to the machine is a [cryptolock], with insulated walls; it looks like a large version of an ice bucket for chilling sparkling wines.
Around the outside of the bucket are all sorts of odd gears, sprockets, parts, and bits, which have been attached in a haphazard way with bolts, wire, and duct tape. Presumably this does something to items placed in the bucket.
At the lip of the bucket is a switch labeled REVERSE. The switch is currently [if the cryptoswitch is switched on]on[otherwise]off[end if]." The carrying capacity of the cryptolock is 1.
The sprocket-bits are part of the cryptolock. Understand "odd" or "gears" or "sprocket" or "sprockets" or "parts" or "bits" or "part" or "bit" or "bolt" or "wire" or "duct" or "tape" as the sprocket-bits. The description of the sprocket-bits is "They're all different metals and component sizes, as though scavenged from other machines. But for what? It would take a much better engineer than I am to guess that."
Check inserting something into the cryptolock when the cryptolock contains something (called the blockage):
try taking the blockage;
if the blockage is in the cryptolock:
stop the action.
Check inserting something into the cryptolock when the heft of the noun is greater than 3:
say "[The noun] [is-are] too big to fit into [the cryptolock]." instead.
A dangerous construction rule for something (called the target):
if the target is in the cryptolock and the heft of the target is greater than 3:
now the target is in the Generator Room;
say "[The target] [is-are] too big to fit into the bucket, and fall[s] out during the process of formation."
Test bucket-size with "put coat in bucket / wave a-remover at coat / get cot / put cot in bucket" holding the coat in the Generator Room.
After inserting something into the cryptolock:
let goal text be indexed text;
if hardness is true:
if the cryptoswitch is switched on:
let goal text be the back hard encryption of the noun;
else:
let goal text be the hard encryption of the noun;
otherwise:
if the cryptoswitch is switched on:
let goal text be the back encryption of the noun;
else:
let goal text be the encryption of the noun;
let source hash be the letter-hash of goal text;
[ say "[substitute text]";]
let chosen article be the noun;
repeat with item running through things in the repository:
if the hash code of the item is the source hash:
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 the noun:
abide by the dangerous destruction rules for the noun;
now the chosen article is not proffered by anything;
now everything which proffers the noun proffers the chosen article;
if the chosen article is enormous:
say "There is a churning noise from within [the cryptolock] and '[goal text]' appears in letters of vivid purple smoke. Additional letters read 'SAFETY OVERRIDE.' Then the smoke dissipates without result." instead;
if an essential thing (called source) proffers the chosen article:
now the chosen article is essential;
[ if something which proffers the chosen article encloses an essential thing:
now the chosen article is essential; ]
now everything which is in the cryptolock is in the repository;
move the chosen article to the cryptolock;
abide by the dangerous construction rules for the chosen article;
say "There is a churning noise from within [the cryptolock], and a moment later [you] see inside [a list of things in the cryptolock]. ";
record "using the vowel rotator" as achieved;
if the boiler is switched off:
now the boiler is switched on;
say "[paragraph break]This appears to have unlocked the mechanism. With a growl, the boiler comes to life.";
otherwise:
say "The boiler growls but cannot become any more on than it already is.";
otherwise:
say "There is a churning noise from within [the cryptolock] and '[goal text]' appears in letters of hot pink smoke. Then the smoke dissipates without result.".
Test cryptoreverse with "tutorial off / autoupgrade / put gimlet in cryptolock / put earring in cryptolock / put pastis in cryptolock / put pea in cryptolock / put ball in cryptolock / wave g-remover at sign / put sin in cryptolock / put son in cryptolock / put tub in bucket / turn on switch / x cryptolock / put tab in bucket" in the Generator Room holding the tub and ball and the pastis and the earring and the pea and the gimlet and the garish sign.
Test crypto with "tutorial off / autoupgrade / x boiler / look through pane / w / turn on platform / e / put gimlet in cryptolock / put earring in cryptolock / put pastis in cryptolock / put pea in cryptolock / put ball in cryptolock / wave g-remover at sign / put sin in cryptolock / put son in cryptolock / x boiler / look through pane / w / turn on platform" in the Generator Room holding the ball and the pastis and the earring and the pea and the gimlet and the garish sign.
[In easy mode, each vowel is replaced by the one subsequent, and U in turn becomes A. Y is not considered a vowel for these purposes.
To avoid confusion during the replacement process, we replace lower-case letters with upper-case ones to show they've already been changed.]
To decide what indexed text is the encryption of (X - a thing):
let goal text be indexed text;
let goal text be "[printed name of the X]";
let goal text be "[goal text in lower case]";
replace the text "a" in goal text with "E";
replace the text "e" in goal text with "I";
replace the text "i" in goal text with "O";
replace the text "o" in goal text with "U";
replace the text "u" in goal text with "A";
let goal text be "[goal text in lower case]";
decide on goal text.
To decide what indexed text is the back encryption of (X - a thing):
let goal text be indexed text;
let goal text be "[printed name of the X]";
let goal text be "[goal text in lower case]";
replace the text "a" in goal text with "U";
replace the text "e" in goal text with "A";
replace the text "i" in goal text with "E";
replace the text "o" in goal text with "I";
replace the text "u" in goal text with "O";
let goal text be "[goal text in lower case]";
decide on goal text.
[In hard mode, each vowel becomes the next consonant in the alphabet and each consonant becomes the next vowel. This has the effect of vastly reducing the number of possible letters in output, and is a bit tricky to think through; but it is possible to get LAMB > OBOE.
To figure out whether the game supplied any objects that could fruitfully be encrypted this way, we ran the encryption on every object in the game and inspected the results for things that were really words.]
To decide what indexed text is the hard encryption of (X - a thing):
let goal text be indexed text;
let goal text be "[printed name of the X]";
let goal text be "[goal text in lower case]";
replace the text "a" in goal text with "B";
replace the text "b" in goal text with "E";
replace the text "c" in goal text with "E";
replace the text "d" in goal text with "E";
replace the text "e" in goal text with "F";
replace the text "f" in goal text with "I";
replace the text "g" in goal text with "I";
replace the text "h" in goal text with "I";
replace the text "i" in goal text with "J";
replace the text "j" in goal text with "O";
replace the text "k" in goal text with "O";
replace the text "l" in goal text with "O";
replace the text "m" in goal text with "O";
replace the text "n" in goal text with "O";
replace the text "o" in goal text with "P";
replace the text "p" in goal text with "U";
replace the text "q" in goal text with "U";
replace the text "r" in goal text with "U";
replace the text "s" in goal text with "U";
replace the text "t" in goal text with "U";
replace the text "u" in goal text with "V";
replace the text "v" in goal text with "A";
replace the text "w" in goal text with "A";
replace the text "x" in goal text with "A";
replace the text "y" in goal text with "A";
replace the text "z" in goal text with "A";
let goal text be "[goal text in lower case]";
decide on goal text.
To decide what indexed text is the back hard encryption of (X - a thing):
let goal text be indexed text;
let goal text be "[printed name of the X]";
let goal text be "[goal text in lower case]";
replace the text "a" in goal text with "Z";
replace the text "b" in goal text with "A";
replace the text "c" in goal text with "A";
replace the text "d" in goal text with "A";
replace the text "e" in goal text with "D";
replace the text "f" in goal text with "E";
replace the text "g" in goal text with "E";
replace the text "h" in goal text with "E";
replace the text "i" in goal text with "H";
replace the text "j" in goal text with "I";
replace the text "k" in goal text with "I";
replace the text "l" in goal text with "I";
replace the text "m" in goal text with "I";
replace the text "n" in goal text with "I";
replace the text "o" in goal text with "N";
replace the text "p" in goal text with "O";
replace the text "q" in goal text with "O";
replace the text "r" in goal text with "O";
replace the text "s" in goal text with "O";
replace the text "t" in goal text with "O";
replace the text "u" in goal text with "T";
replace the text "v" in goal text with "U";
replace the text "w" in goal text with "U";
replace the text "x" in goal text with "U";
replace the text "y" in goal text with "U";
replace the text "z" in goal text with "U";
let goal text be "[goal text in lower case]";
decide on goal text.