An Escape To Remember

An interactive fiction by the IF Whispers Team (2006) - the Inform 7 source text

Home page

Contents
Previous
Next

Complete text
Section 4 - The Toll Machine and Associated Hacks

[This starts off alright, but gets progressively worse. --RC]

[Part 1 - The Machine Proper]

The toll machine is scenery. The description of the toll machine is "This massive steel construction is obviously of much newer design than the bridge on which it sits. Built into its side are a display, a plaque, and two slots -- one white, the other black." The toll machine is in the Bridge.

The toll machine has a number called the total. The total of the toll machine is 0.

The toll machine has a number called the goal.

When Whisper 5 begins:
change the goal of the toll machine to a random number from 153 to 303;
change the total of the toll machine to a random number from -12 to 12.

The plaque is part of the toll machine. The description of the plaque is "A sturdy brass plaque is bolted to the machine. Writing is engraved right into its surface."
The printing of the plaque is
"Heed Now This Royal Proclaimation:

In order to secure entrance to The Holy Sultanate to worthy supplicants, and, we trust, worthy supplicants alone, the following hurdle has been erected as a test of skill. Inserting any numbered card into the white slot will increase the tally of this machine; while using the black slot will decrease the tally a similar amount.

The tally to be reached, as alluded to in the Sacred Scriptures of G'Tarr, is the holy number of [goal of the toll machine].

May the Peace of Heaven guide you."
[The rules of the puzzle, and a bit of colour besides. --RC]

The displayScreen is part of the toll machine. The description of the displayScreen is "It reads: [total of the toll machine]." Understand "display" as the displayScreen. Understand "tally" as the displayScreen. [I think 'display' may be a keyword of some sort. --RC]

Every turn when the location is the Bridge:
If the total of the toll machine is the goal of the toll machine and the toll machine is in the Bridge
begin;
say "The machine begins to emit a strange moan, which grows increasingly louder. As it approaches an intolerable volume, the entire object inexplicably and literally throws itself off the bridge.";
remove the toll machine from play;
end if.
[It seems more polite to only run this daemon while I'm at the bridge, rather than Every Turn throughout the whole game. Whether this really makes any runtime difference is not entirely clear. --RC]

[Part 2 - Playing The Slots]

[A thing can be slotlike. Things are usually not slotlike.]
[A hack, but not a terribly bad hack, I don't think. --RC]
[ revised for space ]
Definition: A thing is slotlike if it is the white slot or it is the black slot.

The white slot is part of the toll machine. The description of the white slot is "The white slot is wide but thin." The white slot is an open container. The white slot is not openable.

The black slot is part of the toll machine. The description of the black slot is "The black slot is wide but thin." The black slot is an open container. The black slot is not openable.

[I wish "not closeable" was a synonym for "not openable" in these sorts of situations. I'll probably write another short-and-dirty little expansion for it. --RC]

[Also, don't be tempted to try "X is *a* part of Y" because that won't work. --RC]

Instead of inserting something into something slotlike, say "That doesn't seem to fit into the slot."

[Part 3 - The Horror of the Cards]

[I would like to blame most of this on the author who defined the cards in the first place, but I'm at least equally to blame here. --RC]

[A thing can be cardlike. Things are usually not cardlike. The yellow card is cardlike. The orange card is cardlike. The green card is cardlike. The red card is cardlike.]
[ revised for space ]
Definition: A thing is cardlike if it is the yellow card or it is the orange card or it is the green card or it is the red card.

Instead of inserting something cardlike into the white slot:
say "The machine processes the card for a moment, and then spits it out. You pick it up off the bridge before it blows away. You notice that the display seems to have changed.";
If the noun is the red card, increase the total of the toll machine by the code corresponding to a fruit of petrified apple in Table MM1;
If the noun is the green card, increase the total of the toll machine by the code corresponding to a fruit of petrified grape in Table MM1;
If the noun is the orange card, increase the total of the toll machine by the code corresponding to a fruit of petrified orange in Table MM1;
If the noun is the yellow card, increase the total of the toll machine by the code corresponding to a fruit of petrified lemon in Table MM1;
now the player has the noun.

Instead of inserting something cardlike into the black slot:
say "The machine processes the card for a moment, and then spits it out. You pick it up off the bridge before it blows away. You notice that the display seems to have changed.";
If the noun is the red card, decrease the total of the toll machine by the code corresponding to a fruit of petrified apple in Table MM1;
If the noun is the green card, decrease the total of the toll machine by the code corresponding to a fruit of petrified grape in Table MM1;
If the noun is the orange card, decrease the total of the toll machine by the code corresponding to a fruit of petrified orange in Table MM1;
If the noun is the yellow card, decrease the total of the toll machine by the code corresponding to a fruit of petrified lemon in Table MM1;
now the player has the noun.

Instead of turning the red card:
If the code corresponding to a fruit of petrified apple in Table MM1 is 91 begin;
choose row with a fruit of petrified apple in Table MM1;
change code entry to 16;
say "You spin the card around, and now it seems to read 16.";
stop;
end if;
If the code corresponding to a fruit of petrified apple in Table MM1 is 61 begin;
choose row with a fruit of petrified apple in Table MM1;
change code entry to 19;
say "You spin the card around, and now it seems to read 19.";
stop;
end if;
If the code corresponding to a fruit of petrified apple in Table MM1 is 19 begin;
choose row with a fruit of petrified apple in Table MM1;
change code entry to 61;
say "You spin the card around, and now it seems to read 61.";
stop;
end if;
If the code corresponding to a fruit of petrified apple in Table MM1 is 16 begin;
choose row with a fruit of petrified apple in Table MM1;
change code entry to 91;
say "You spin the card around, and now it seems to read 91.";
stop;
end if;
If the code corresponding to a fruit of petrified apple in Table MM1 is 3 begin;
say "You spin the card around, but an upside-down '3' doesn't really look like anything other than a funny 'E', so you turn it right-side up again.";
end if;
If the code corresponding to a fruit of petrified apple in Table MM1 is 2 begin;
say "You spin the card around, but an upside-down '2' doesn't really look like anything, so you turn it right-side up again.";
end if.

Instead of turning the orange card:
If the code corresponding to a fruit of petrified orange in Table MM1 is 91 begin;
choose row with a fruit of petrified orange in Table MM1;
change code entry to 16;
say "You spin the card around, and now it seems to read 16.";
end if;
If the code corresponding to a fruit of petrified orange in Table MM1 is 61 begin;
choose row with a fruit of petrified orange in Table MM1;
change code entry to 19;
say "You spin the card around, and now it seems to read 19.";
end if;
If the code corresponding to a fruit of petrified orange in Table MM1 is 19 begin;
choose row with a fruit of petrified orange in Table MM1;
change code entry to 61;
say "You spin the card around, and now it seems to read 61.";
end if;
If the code corresponding to a fruit of petrified orange in Table MM1 is 16 begin;
choose row with a fruit of petrified orange in Table MM1;
change code entry to 91;
say "You spin the card around, and now it seems to read 91.";
end if;
If the code corresponding to a fruit of petrified orange in Table MM1 is 3 begin;
say "You spin the card around, but an upside-down '3' doesn't really look like anything other than a funny 'E', so you turn it right-side up again.";
end if;
If the code corresponding to a fruit of petrified orange in Table MM1 is 2 begin;
say "You spin the card around, but an upside-down '2' doesn't really look like anything, so you turn it right-side up again.";
end if.

Instead of turning the yellow card:
If the code corresponding to a fruit of petrified lemon in Table MM1 is 91 begin;
choose row with a fruit of petrified lemon in Table MM1;
change code entry to 16;
say "You spin the card around, and now it seems to read 16.";
end if;
If the code corresponding to a fruit of petrified lemon in Table MM1 is 61 begin;
choose row with a fruit of petrified lemon in Table MM1;
change code entry to 19;
say "You spin the card around, and now it seems to read 19.";
end if;
If the code corresponding to a fruit of petrified lemon in Table MM1 is 19 begin;
choose row with a fruit of petrified lemon in Table MM1;
change code entry to 61;
say "You spin the card around, and now it seems to read 61.";
end if;
If the code corresponding to a fruit of petrified lemon in Table MM1 is 16 begin;
choose row with a fruit of petrified lemon in Table MM1;
change code entry to 91;
say "You spin the card around, and now it seems to read 91.";
end if;
If the code corresponding to a fruit of petrified lemon in Table MM1 is 3 begin;
say "You spin the card around, but an upside-down '3' doesn't really look like anything other than a funny 'E', so you turn it right-side up again.";
end if;
If the code corresponding to a fruit of petrified lemon in Table MM1 is 2 begin;
say "You spin the card around, but an upside-down '2' doesn't really look like anything, so you turn it right-side up again.";
end if.

Instead of turning the green card:
If the code corresponding to a fruit of petrified grape in Table MM1 is 91 begin;
choose row with a fruit of petrified grape in Table MM1;
change code entry to 16;
say "You spin the card around, and now it seems to read 16.";
end if;
If the code corresponding to a fruit of petrified grape in Table MM1 is 61 begin;
choose row with a fruit of petrified grape in Table MM1;
change code entry to 19;
say "You spin the card around, and now it seems to read 19.";
end if;
If the code corresponding to a fruit of petrified grape in Table MM1 is 19 begin;
choose row with a fruit of petrified grape in Table MM1;
change code entry to 61;
say "You spin the card around, and now it seems to read 61.";
end if;
If the code corresponding to a fruit of petrified grape in Table MM1 is 16 begin;
choose row with a fruit of petrified grape in Table MM1;
change code entry to 91;
say "You spin the card around, and now it seems to read 91.";
end if;
If the code corresponding to a fruit of petrified grape in Table MM1 is 3 begin;
say "You spin the card around, but an upside-down '3' doesn't really look like anything other than a funny 'E', so you turn it right-side up again.";
end if;
If the code corresponding to a fruit of petrified grape in Table MM1 is 2 begin;
say "You spin the card around, but an upside-down '2' doesn't really look like anything, so you turn it right-side up again.";
end if.

[Yes, yes, yes -- I know that was horrid. --RC]

[In defense of the 'turning the cards' puzzle -- this part is optional, really. It just makes the goal easier to get to. With 'G' (again) it shouldn't be that much of a burden on the player to reach the goal even without figuring to turn the cards around. --RC]