Fragment of a Greek Tragedy

Example 374
★★

Responding to the player's input based on keywords only, and overriding the original parser entirely.

Apologies to the shade of A. E. Housman.

"Fragment of a Greek Tragedy"
Understand "restart/restore/save/quit" as "[meta-command]".
After reading a command:
   if the player's command matches "[meta-command]", make no decision;
   say line break;
   repeat through Table of Current Topics:
      if the player's command includes topic entry:
         say "CHORUS: [reply entry][paragraph break]";
         follow the advance time rule;
         rule succeeds;
   say "[italic type] Pause.[roman type][line break]";
   follow the advance time rule;
   rule succeeds.
Table of Current Topics
topicreply
"journey/trip/travel/came/arrived""Sailing on horseback, or with feet for oars?"
"horseback/legs/feet/oars""Beneath a shining or a rainy Zeus?"
"shining/rainy/weather/zeus""Mud's sister, not herself, adorns thy boots."

This would be a bit bare if we didn't provide the player with some sort of context at the outset, so let's put some remarks before the first command prompt:

Before reading a command while the turn count is 1:
   say "CHORUS: O suitably-attired-in-leather-boots
   Head of a traveller, wherefore seeking whom
   Whence by what way how purposed art thou come
   To this well-nightingaled vicinity?
   My object in inquiring is to know.
   But if you happen to be deaf and dumb
   And do not understand a word I say,
   Then wave your hand, to signify as much."

This "turn count" condition is why it was useful to follow the advance time rule in "after reading a command": the game (or drama, if you like) will continue to count moves elapsed even though the rest of Inform's command parsing and world model is being ignored. In a longer and more ambitious implementation of this idea, we might want to allow scenes to govern the behavior and responses of the Chorus.

And then to give the whole exchange a play's format:

The Stage is a room.
The room description heading rule is not listed in the carry out looking rules.
When play begins:
   now the command prompt is "YOU: ";
   now left hand status line is "Fragment of a Greek Tragedy";
   now right hand status line is "A. E. Housman".

(Because this example manipulates commands outside of the normal parser, the mechanism for TEST will not work here. Try typing commands such as: TELL CHORUS ABOUT JOURNEY / TELL CHORUS ABOUT FEET / TELL CHORUS ABOUT SHROPSHIRE / TELL CHORUS ABOUT ZEUS)