![]() |
How the characters live |
Seventeen characters share the world with the player, and every one of them takes a turn after each of the player's -- wherever it is, seen or not. A character is an ordinary object record with a slot in CHARACTERS pointing into a small script, and what it does is always an action tried as if it had typed it, through the same code as the player's (How a sentence is understood). This page is the machinery, and twenty real turns of it.
Seven bytes each, from CHARACTERS, read from the tape: the character, how many of its ordinary scripts a random switch may choose among, where its script has got to, its script table, and how many of the player's orders it takes at once. Three slots are empty on the tape and are filled in by arrival hooks when the story reaches their characters. The step names are the listing's labels.
A script is a list of steps. The low four bits of a step's first byte are its opcode (read from CHARACTERS_ACT's own tests):
| Opcode | Bytes | Does |
|---|---|---|
| 0, 2 | 4 | an action and its two objects, tried as the character's own sentence (SCRIPT_DO); $FF for an object means whatever fits |
| 1, 3 | 4 | a routine, run first as a test with printing off and again for real only if it set SUCCEEDED (also SCRIPT_DO); the fourth byte is not used |
| 4 | 2 | an action with no objects, which acts on whatever fits (SCRIPT_BARE); action $FF is a pause: nothing this turn |
| $0C | 2 | switch to its reaction script for the action that follows (REACT) |
| $0E | 3 | go to the address that follows, and carry on |
| $0F | 2 | switch to one of its ordinary scripts at random (SCRIPT_RANDOM): the lesser of the operand and the slot's byte 1 bounds the choice |
| other | 1 | back to its first script; the turn is over |
and three more bits of the same byte change how it is taken:
| Bit | Means |
|---|---|
| 4 ($10) | a two-byte fallback follows: where the script goes on if the step is refused |
| 5 ($20) | used up: once it works SCRIPT_DO writes 0 over the step's first byte (only Thorin's remark about the small curious key has it) |
| 6 ($40) | an order from the player cannot interrupt it |
The whole of every script is written out on the Characters page.
END_OF_TURN calls CHARACTERS_ACT, which goes through the slots in order. For each character (read):
So what a character does is decided and done whether anyone sees it or not; the player is told only what happens in sight. The runs below show both, because the sentences were captured at PRINT_CHAR before its gate, while DOING_IT said the action was real, which is where the out-of-sight ones are composed and then not printed.
A game started as the build starts one, and WAIT typed at the first prompt 20 times, in Bag End, in SkoolKit's simulator. Probes on CHARACTERS_ACT's slot loop ($9826), each step it considers (SCRIPT_STEP, $9885), the refusals ($99AA), the random switches, DO_ACTION's call from ACTOR_TRIES ($9A32) and REACT recorded each character's turn; the places are the object records' location bytes after each turn. Gandalf, Thorin and the vicious warg:
| Turn | Steps tried | What it did | Where after |
|---|---|---|---|
| 1 | $C8BE: OPEN: round green door (done) | gandalf opens the round green door. | tunnel like hall |
| 2 | GANDALF_A: RUN (done) | gandalf goes east. | lonelands |
| 3 | $C8C4: TAKE; if refused, on at GANDALF_B (refused) GANDALF_B: RUN (done) | gandalf goes northeast. (out of sight: not printed) | trolls path |
| 4 | $C8D2: DROP (refused) GANDALF_C: RUN (refused) $C8D6: Call GANDALF_CHATTER (done) | gandalf says " you are doing a great job ". (out of sight: not printed) | trolls path |
| 5 | GANDALF_D: RUN (refused) $C8DC: GIVE TO (refused) GANDALF_E: OPEN (refused) $C8E0: Switch to one of its first 4 scripts at random GANDALF_B: RUN (done) one random switch | gandalf goes south. (out of sight: not printed) | trolls clearing |
| 6 | $C8D2: DROP (refused) GANDALF_C: RUN (done) | gandalf goes southeast. (out of sight: not printed) | rivendell |
| 7 | $C8D6: Call GANDALF_CHATTER (done) | gandalf says " you are doing a great job ". (out of sight: not printed) | rivendell |
| 8 | GANDALF_D: RUN (done) | gandalf goes east. (out of sight: not printed) | misty mountain |
| 9 | $C8DC: GIVE TO (refused) GANDALF_E: OPEN (refused) $C8E0: Switch to one of its first 4 scripts at random GANDALF_B: RUN (done) one random switch | gandalf goes north. (out of sight: not printed) | narrow path |
| 10 | $C8D2: DROP (refused) GANDALF_C: RUN (done) | gandalf goes south. (out of sight: not printed) | misty mountain |
| 11 | $C8D6: Call GANDALF_CHATTER (done) | gandalf says " hurry up ". (out of sight: not printed) | misty mountain |
| 12 | GANDALF_D: RUN (done) | gandalf goes north. (out of sight: not printed) | narrow path |
| 13 | $C8DC: GIVE TO (refused) GANDALF_E: OPEN (refused) $C8E0: Switch to one of its first 4 scripts at random GANDALF_E: OPEN (refused) $C8E0: Switch to one of its first 4 scripts at random GANDALF_E: OPEN (refused) $C8E0: Switch to one of its first 4 scripts at random GANDALF_A: RUN (done) three random switches | gandalf goes south. (out of sight: not printed) | misty mountain |
| 14 | $C8C4: TAKE; if refused, on at GANDALF_B (refused) GANDALF_B: RUN (done) | gandalf goes north. (out of sight: not printed) | narrow path |
| 15 | $C8D2: DROP (refused) GANDALF_C: RUN (done) | gandalf goes east. (out of sight: not printed) | narrow path |
| 16 | $C8D6: Call GANDALF_CHATTER (done) | gandalf says " you are doing a great job ". (out of sight: not printed) | narrow path |
| 17 | GANDALF_D: RUN (done) | gandalf goes northwest. (out of sight: not printed) | narrow path |
| 18 | $C8DC: GIVE TO (refused) GANDALF_E: OPEN (refused) $C8E0: Switch to one of its first 4 scripts at random GANDALF_D: RUN (done) one random switch | gandalf goes southwest. (out of sight: not printed) | narrow path |
| 19 | $C8DC: GIVE TO (refused) GANDALF_E: OPEN (refused) $C8E0: Switch to one of its first 4 scripts at random GANDALF_C: RUN (done) one random switch | gandalf goes south. (out of sight: not printed) | misty mountain |
| 20 | $C8D6: Call GANDALF_CHATTER (done) | gandalf says " hurry up ". (out of sight: not printed) | misty mountain |
Gandalf's first steps give the player the curious map and open the round green door (the map before the first prompt, the door on the first WAIT). After that he has five ordinary scripts (GANDALF_A, GANDALF_B, GANDALF_C, GANDALF_D, GANDALF_E), and they are one list entered at different places: each is RUN and one more thing, running on into the next, and the last ends in a switch at random. So he goes somewhere, tries to do something there -- take, drop, give, chat, open, close -- and goes on, and a refusal falls through to the next step. Where he is after twenty turns is chance: RUN picks a direction with RANDOM, and the switches pick a script.
| Turn | Steps tried | What it did | Where after |
|---|---|---|---|
| 1 | $C910: Go to THORIN_A THORIN_A: FOLLOW: the player; if refused, on at THORIN_B (refused) THORIN_B: TAKE: small curious key; if refused, on at THORIN_C (refused) THORIN_C: Call THORIN_WHERES_THIEF; if refused, on at THORIN_D (refused) THORIN_D: Call THORIN_CHATTER (done) | thorin waits. | tunnel like hall |
| 2 | $C910: Go to THORIN_A THORIN_A: FOLLOW: the player; if refused, on at THORIN_B (refused) THORIN_B: TAKE: small curious key; if refused, on at THORIN_C (refused) THORIN_C: Call THORIN_WHERES_THIEF; if refused, on at THORIN_D (refused) THORIN_D: Call THORIN_CHATTER (done) | thorin waits. | tunnel like hall |
| 3 | $C910: Go to THORIN_A THORIN_A: FOLLOW: the player; if refused, on at THORIN_B (refused) THORIN_B: TAKE: small curious key; if refused, on at THORIN_C (refused) THORIN_C: Call THORIN_WHERES_THIEF; if refused, on at THORIN_D (refused) THORIN_D: Call THORIN_CHATTER (done) | - | tunnel like hall |
| 4 | $C910: Go to THORIN_A THORIN_A: FOLLOW: the player; if refused, on at THORIN_B (refused) THORIN_B: TAKE: small curious key; if refused, on at THORIN_C (refused) THORIN_C: Call THORIN_WHERES_THIEF; if refused, on at THORIN_D (refused) THORIN_D: Call THORIN_CHATTER (done) | thorin waits. | tunnel like hall |
| 5 | $C910: Go to THORIN_A THORIN_A: FOLLOW: the player; if refused, on at THORIN_B (refused) THORIN_B: TAKE: small curious key; if refused, on at THORIN_C (refused) THORIN_C: Call THORIN_WHERES_THIEF; if refused, on at THORIN_D (refused) THORIN_D: Call THORIN_CHATTER (done) | thorin says " hurry up ". | tunnel like hall |
| 6 | $C910: Go to THORIN_A THORIN_A: FOLLOW: the player; if refused, on at THORIN_B (refused) THORIN_B: TAKE: small curious key; if refused, on at THORIN_C (refused) THORIN_C: Call THORIN_WHERES_THIEF; if refused, on at THORIN_D (refused) THORIN_D: Call THORIN_CHATTER (done) | thorin sits down and starts singing about gold. | tunnel like hall |
| 7 | $C910: Go to THORIN_A THORIN_A: FOLLOW: the player; if refused, on at THORIN_B (refused) THORIN_B: TAKE: small curious key; if refused, on at THORIN_C (refused) THORIN_C: Call THORIN_WHERES_THIEF; if refused, on at THORIN_D (refused) THORIN_D: Call THORIN_CHATTER (done) | - | tunnel like hall |
| 8 | $C910: Go to THORIN_A THORIN_A: FOLLOW: the player; if refused, on at THORIN_B (refused) THORIN_B: TAKE: small curious key; if refused, on at THORIN_C (refused) THORIN_C: Call THORIN_WHERES_THIEF; if refused, on at THORIN_D (refused) THORIN_D: Call THORIN_CHATTER (done) | thorin sits down and starts singing about gold. | tunnel like hall |
| 9 | $C910: Go to THORIN_A THORIN_A: FOLLOW: the player; if refused, on at THORIN_B (refused) THORIN_B: TAKE: small curious key; if refused, on at THORIN_C (refused) THORIN_C: Call THORIN_WHERES_THIEF; if refused, on at THORIN_D (refused) THORIN_D: Call THORIN_CHATTER (done) | - | tunnel like hall |
| 10 | $C910: Go to THORIN_A THORIN_A: FOLLOW: the player; if refused, on at THORIN_B (refused) THORIN_B: TAKE: small curious key; if refused, on at THORIN_C (refused) THORIN_C: Call THORIN_WHERES_THIEF; if refused, on at THORIN_D (refused) THORIN_D: Call THORIN_CHATTER (done) | - | tunnel like hall |
| 11 | $C910: Go to THORIN_A THORIN_A: FOLLOW: the player; if refused, on at THORIN_B (refused) THORIN_B: TAKE: small curious key; if refused, on at THORIN_C (refused) THORIN_C: Call THORIN_WHERES_THIEF; if refused, on at THORIN_D (refused) THORIN_D: Call THORIN_CHATTER (done) | - | tunnel like hall |
| 12 | $C910: Go to THORIN_A THORIN_A: FOLLOW: the player; if refused, on at THORIN_B (refused) THORIN_B: TAKE: small curious key; if refused, on at THORIN_C (refused) THORIN_C: Call THORIN_WHERES_THIEF; if refused, on at THORIN_D (refused) THORIN_D: Call THORIN_CHATTER (done) | - | tunnel like hall |
| 13 | $C910: Go to THORIN_A THORIN_A: FOLLOW: the player; if refused, on at THORIN_B (refused) THORIN_B: TAKE: small curious key; if refused, on at THORIN_C (refused) THORIN_C: Call THORIN_WHERES_THIEF; if refused, on at THORIN_D (refused) THORIN_D: Call THORIN_CHATTER (done) | - | tunnel like hall |
| 14 | $C910: Go to THORIN_A THORIN_A: FOLLOW: the player; if refused, on at THORIN_B (refused) THORIN_B: TAKE: small curious key; if refused, on at THORIN_C (refused) THORIN_C: Call THORIN_WHERES_THIEF; if refused, on at THORIN_D (refused) THORIN_D: Call THORIN_CHATTER (done) | - | tunnel like hall |
| 15 | $C910: Go to THORIN_A THORIN_A: FOLLOW: the player; if refused, on at THORIN_B (refused) THORIN_B: TAKE: small curious key; if refused, on at THORIN_C (refused) THORIN_C: Call THORIN_WHERES_THIEF; if refused, on at THORIN_D (refused) THORIN_D: Call THORIN_CHATTER (done) | thorin says " hurry up ". | tunnel like hall |
| 16 | $C910: Go to THORIN_A THORIN_A: FOLLOW: the player; if refused, on at THORIN_B (refused) THORIN_B: TAKE: small curious key; if refused, on at THORIN_C (refused) THORIN_C: Call THORIN_WHERES_THIEF; if refused, on at THORIN_D (refused) THORIN_D: Call THORIN_CHATTER (done) | thorin says " hurry up ". | tunnel like hall |
| 17 | $C910: Go to THORIN_A THORIN_A: FOLLOW: the player; if refused, on at THORIN_B (refused) THORIN_B: TAKE: small curious key; if refused, on at THORIN_C (refused) THORIN_C: Call THORIN_WHERES_THIEF; if refused, on at THORIN_D (refused) THORIN_D: Call THORIN_CHATTER (done) | - | tunnel like hall |
| 18 | $C910: Go to THORIN_A THORIN_A: FOLLOW: the player; if refused, on at THORIN_B (refused) THORIN_B: TAKE: small curious key; if refused, on at THORIN_C (refused) THORIN_C: Call THORIN_WHERES_THIEF; if refused, on at THORIN_D (refused) THORIN_D: Call THORIN_CHATTER (done) | thorin sits down and starts singing about gold. | tunnel like hall |
| 19 | $C910: Go to THORIN_A THORIN_A: FOLLOW: the player; if refused, on at THORIN_B (refused) THORIN_B: TAKE: small curious key; if refused, on at THORIN_C (refused) THORIN_C: Call THORIN_WHERES_THIEF; if refused, on at THORIN_D (refused) THORIN_D: Call THORIN_CHATTER (done) | - | tunnel like hall |
| 20 | $C910: Go to THORIN_A THORIN_A: FOLLOW: the player; if refused, on at THORIN_B (refused) THORIN_B: TAKE: small curious key; if refused, on at THORIN_C (refused) THORIN_C: Call THORIN_WHERES_THIEF; if refused, on at THORIN_D (refused) THORIN_D: Call THORIN_CHATTER (done) | thorin waits. | tunnel like hall |
Thorin's script is a loop that tries the same things in the same order every turn: FOLLOW the player (refused: they are already together), TAKE the small curious key (refused: it is not here), ask where the thief is (refused: the player can be seen), and then his chatter routine, which always does something -- waits, says his line or sings -- and ends his turn. The script then goes back to the start. Only the last step is ever seen.
| Turn | Steps tried | What it did | Where after |
|---|---|---|---|
| 1 | $C93E: Go to VICIOUS_WARG_A VICIOUS_WARG_A: ATTACK WITH; if refused, on at VICIOUS_WARG_B (refused) VICIOUS_WARG_B: FOLLOW; if refused, on at VICIOUS_WARG_C (refused) VICIOUS_WARG_C: RUN; if refused, on at VICIOUS_WARG_D (done) | the vicious warg goes northwest. (out of sight: not printed) | outside goblins gate |
| 2 | $C93E: Go to VICIOUS_WARG_A VICIOUS_WARG_A: ATTACK WITH; if refused, on at VICIOUS_WARG_B (refused) VICIOUS_WARG_B: FOLLOW; if refused, on at VICIOUS_WARG_C (refused) VICIOUS_WARG_C: RUN; if refused, on at VICIOUS_WARG_D (done) | the vicious warg goes east. (out of sight: not printed) | treeless opening |
| 3 | $C93E: Go to VICIOUS_WARG_A VICIOUS_WARG_A: ATTACK WITH; if refused, on at VICIOUS_WARG_B (refused) VICIOUS_WARG_B: FOLLOW; if refused, on at VICIOUS_WARG_C (refused) VICIOUS_WARG_C: RUN; if refused, on at VICIOUS_WARG_D (done) | the vicious warg goes west. (out of sight: not printed) | outside goblins gate |
| 4 | $C93E: Go to VICIOUS_WARG_A VICIOUS_WARG_A: ATTACK WITH; if refused, on at VICIOUS_WARG_B (refused) VICIOUS_WARG_B: FOLLOW; if refused, on at VICIOUS_WARG_C (refused) VICIOUS_WARG_C: RUN; if refused, on at VICIOUS_WARG_D (done) | the vicious warg goes east. (out of sight: not printed) | treeless opening |
| 5 | $C93E: Go to VICIOUS_WARG_A VICIOUS_WARG_A: ATTACK WITH; if refused, on at VICIOUS_WARG_B (refused) VICIOUS_WARG_B: FOLLOW; if refused, on at VICIOUS_WARG_C (refused) VICIOUS_WARG_C: RUN; if refused, on at VICIOUS_WARG_D (done) | the vicious warg goes east. (out of sight: not printed) | beorns house |
| 6 | $C93E: Go to VICIOUS_WARG_A VICIOUS_WARG_A: ATTACK WITH; if refused, on at VICIOUS_WARG_B (refused) VICIOUS_WARG_B: FOLLOW; if refused, on at VICIOUS_WARG_C (refused) VICIOUS_WARG_C: RUN; if refused, on at VICIOUS_WARG_D (done) | the vicious warg goes northeast. (out of sight: not printed) | forest gate |
| 7 | $C93E: Go to VICIOUS_WARG_A VICIOUS_WARG_A: ATTACK WITH; if refused, on at VICIOUS_WARG_B (refused) VICIOUS_WARG_B: FOLLOW; if refused, on at VICIOUS_WARG_C (refused) VICIOUS_WARG_C: RUN; if refused, on at VICIOUS_WARG_D (done) | the vicious warg goes south. (out of sight: not printed) | forest road |
| 8 | $C93E: Go to VICIOUS_WARG_A VICIOUS_WARG_A: ATTACK WITH; if refused, on at VICIOUS_WARG_B (refused) VICIOUS_WARG_B: FOLLOW; if refused, on at VICIOUS_WARG_C (refused) VICIOUS_WARG_C: RUN; if refused, on at VICIOUS_WARG_D (done) | the vicious warg goes north. (out of sight: not printed) | forest gate |
| 9 | $C93E: Go to VICIOUS_WARG_A VICIOUS_WARG_A: ATTACK WITH; if refused, on at VICIOUS_WARG_B (refused) VICIOUS_WARG_B: FOLLOW; if refused, on at VICIOUS_WARG_C (refused) VICIOUS_WARG_C: RUN; if refused, on at VICIOUS_WARG_D (done) | the vicious warg goes east. (out of sight: not printed) | bewitched gloomy place |
| 10 | $C93E: Go to VICIOUS_WARG_A VICIOUS_WARG_A: ATTACK WITH; if refused, on at VICIOUS_WARG_B (done) | the vicious warg attacks the wood elf. a fast blow knocks the wind out of the elf. (out of sight: not printed) | bewitched gloomy place |
| 11 | $C92C: Go to VICIOUS_WARG_A VICIOUS_WARG_A: ATTACK WITH; if refused, on at VICIOUS_WARG_B (refused) VICIOUS_WARG_B: FOLLOW; if refused, on at VICIOUS_WARG_C (refused) VICIOUS_WARG_C: RUN; if refused, on at VICIOUS_WARG_D (refused) VICIOUS_WARG_D: Pause: nothing this turn (done) | - | dark dungeon |
| 12 | $C943: Go to VICIOUS_WARG_A VICIOUS_WARG_A: ATTACK WITH; if refused, on at VICIOUS_WARG_B (refused) VICIOUS_WARG_B: FOLLOW; if refused, on at VICIOUS_WARG_C (refused) VICIOUS_WARG_C: RUN; if refused, on at VICIOUS_WARG_D (refused) VICIOUS_WARG_D: Pause: nothing this turn (done) | - | dark dungeon |
| 13 | $C943: Go to VICIOUS_WARG_A VICIOUS_WARG_A: ATTACK WITH; if refused, on at VICIOUS_WARG_B (refused) VICIOUS_WARG_B: FOLLOW; if refused, on at VICIOUS_WARG_C (refused) VICIOUS_WARG_C: RUN; if refused, on at VICIOUS_WARG_D (refused) VICIOUS_WARG_D: Pause: nothing this turn (done) | - | dark dungeon |
| 14 | $C943: Go to VICIOUS_WARG_A VICIOUS_WARG_A: ATTACK WITH; if refused, on at VICIOUS_WARG_B (refused) VICIOUS_WARG_B: FOLLOW; if refused, on at VICIOUS_WARG_C (refused) VICIOUS_WARG_C: RUN; if refused, on at VICIOUS_WARG_D (refused) VICIOUS_WARG_D: Pause: nothing this turn (done) | - | dark dungeon |
| 15 | $C943: Go to VICIOUS_WARG_A VICIOUS_WARG_A: ATTACK WITH; if refused, on at VICIOUS_WARG_B (refused) VICIOUS_WARG_B: FOLLOW; if refused, on at VICIOUS_WARG_C (refused) VICIOUS_WARG_C: RUN; if refused, on at VICIOUS_WARG_D (refused) VICIOUS_WARG_D: Pause: nothing this turn (done) | - | dark dungeon |
| 16 | $C943: Go to VICIOUS_WARG_A VICIOUS_WARG_A: ATTACK WITH; if refused, on at VICIOUS_WARG_B (refused) VICIOUS_WARG_B: FOLLOW; if refused, on at VICIOUS_WARG_C (refused) VICIOUS_WARG_C: RUN; if refused, on at VICIOUS_WARG_D (refused) VICIOUS_WARG_D: Pause: nothing this turn (done) | - | dark dungeon |
| 17 | $C943: Go to VICIOUS_WARG_A VICIOUS_WARG_A: ATTACK WITH; if refused, on at VICIOUS_WARG_B (refused) VICIOUS_WARG_B: FOLLOW; if refused, on at VICIOUS_WARG_C (refused) VICIOUS_WARG_C: RUN; if refused, on at VICIOUS_WARG_D (refused) VICIOUS_WARG_D: Pause: nothing this turn (done) | - | dark dungeon |
| 18 | $C943: Go to VICIOUS_WARG_A VICIOUS_WARG_A: ATTACK WITH; if refused, on at VICIOUS_WARG_B (refused) VICIOUS_WARG_B: FOLLOW; if refused, on at VICIOUS_WARG_C (refused) VICIOUS_WARG_C: RUN; if refused, on at VICIOUS_WARG_D (refused) VICIOUS_WARG_D: Pause: nothing this turn (done) | - | dark dungeon |
| 19 | $C943: Go to VICIOUS_WARG_A VICIOUS_WARG_A: ATTACK WITH; if refused, on at VICIOUS_WARG_B (refused) VICIOUS_WARG_B: FOLLOW; if refused, on at VICIOUS_WARG_C (refused) VICIOUS_WARG_C: RUN; if refused, on at VICIOUS_WARG_D (refused) VICIOUS_WARG_D: Pause: nothing this turn (done) | - | dark dungeon |
| 20 | $C943: Go to VICIOUS_WARG_A VICIOUS_WARG_A: ATTACK WITH; if refused, on at VICIOUS_WARG_B (refused) VICIOUS_WARG_B: FOLLOW; if refused, on at VICIOUS_WARG_C (refused) VICIOUS_WARG_C: RUN; if refused, on at VICIOUS_WARG_D (refused) VICIOUS_WARG_D: Pause: nothing this turn (done) | - | dark dungeon |
The warg's script is ATTACK WITH, whatever fits; failing that FOLLOW and howl; failing that RUN; failing that a pause. Every turn it could see nobody to attack, so it ran. Then it met the wood elf, attacked, and the fight is decided as on How a fight is decided. The elf's answer, on its next turn, was to capture it, and captives of the elf go to dark dungeon: there RUN is refused, and the warg pauses every turn.
Reactions seen in these twenty turns -- the calls of REACT from REACT_TO_ACTION whose target was a character:
REACT_TO_ACTION also calls REACT, harmlessly, for many actions with no target at all (a RUN, say): it tests the flags of whatever record TARGET_RECORD last held, and REACT then finds no character numbered $FF (read, and seen in the same run).
The player stays in Bag End throughout; the location of each after every turn, grey where it did not change (the wood elf, whose turns are not tabled above, is added for the warg's sake):
The same twenty turns for all the characters in play: how many turns each took, how many steps it considered and how many of those were refused, the random switches, how many places it was in, and how many of its turns the player was told about.
| Character | Turns | Steps | Refused | Random switches | Places | Seen |
|---|---|---|---|---|---|---|
| gandalf | 20 | 47 | 20 | 7 | 9 | 2 |
| thorin | 20 | 100 | 60 | 0 | 1 | 10 |
| wood elf | 20 | 113 | 58 | 0 | 3 | 0 |
| vicious warg | 20 | 88 | 48 | 0 | 7 | 0 |
| elrond | 20 | 30 | 10 | 0 | 1 | 0 |
| gollum | 20 | 80 | 50 | 0 | 4 | 0 |
| hideous troll | 20 | 140 | 120 | 0 | 1 | 0 |
| vicious troll | 20 | 140 | 120 | 0 | 1 | 0 |
| nasty goblin | 20 | 37 | 14 | 0 | 3 | 0 |
| hideous goblin | 20 | 55 | 30 | 0 | 3 | 0 |
| vicious goblin | 20 | 40 | 20 | 0 | 3 | 0 |
| horrible goblin | 20 | 85 | 44 | 0 | 9 | 0 |
| mean goblin | 20 | 80 | 40 | 0 | 8 | 0 |
| disgusting goblin | 20 | 80 | 40 | 0 | 10 | 0 |
Almost everything happens out of sight: the trolls try their one step six times a turn and are refused each time until the player comes, the goblins patrol their tunnels, Gollum paces by his lake, and only gandalf and thorin were seen at all. Nothing in the scripts is tied to a place, which is why no two games play alike.
A script table's entries keyed 0 are the ordinary scripts; any other key is an action code, and that entry is the character's reaction when that action is done to it. After an action for real, DO_ACTION calls REACT_TO_ACTION for each object that is a living character, and REACT looks the action up in the character's table and, if it is there, moves its script to that entry. Every table in the game:
| Table | Used by | Ordinary scripts | Reactions |
|---|---|---|---|
| NASTY_GOBLIN_SCRIPTS | nasty goblin, hideous goblin | 1 | ATTACK WITH: GOBLINS_ON_ATTACK_WITH |
| VICIOUS_GOBLIN_SCRIPTS | vicious goblin | 1 | ATTACK WITH: GOBLINS_ON_ATTACK_WITH |
| HORRIBLE_GOBLIN_SCRIPTS | horrible goblin, mean goblin, disgusting goblin | 1 | ATTACK WITH: GOBLINS_ON_ATTACK_WITH |
| GANDALF_SCRIPTS | gandalf | 5 | GIVE TO: ON_GIVE_TO; CAPTURE: GANDALF_ON_CAPTURE; ATTACK WITH: ON_ATTACK_WITH |
| THORIN_SCRIPTS | thorin | 1 | GIVE TO: ON_GIVE_TO; ATTACK WITH: ON_ATTACK_WITH |
| WOOD_ELF_SCRIPTS | wood elf | 1 | ATTACK WITH: WOOD_ELF_A; GIVE TO: ON_GIVE_TO |
| VICIOUS_WARG_SCRIPTS | vicious warg | 1 | - |
| BUTLER_SCRIPTS | butler | 1 | ATTACK WITH: BUTLER_ON_ATTACK_WITH; GIVE TO: ON_GIVE_TO |
| ELROND_SCRIPTS | elrond | 1 | ATTACK WITH: ELROND_ON_ATTACK_WITH; GIVE TO: ON_GIVE_TO |
| RED_GOLDEN_DRAGON_SCRIPTS | red golden dragon | 1 | ATTACK WITH: RED_GOLDEN_DRAGON_ON_ATTACK_WITH |
| BARD_SCRIPTS | bard | 1 | ATTACK WITH: BARD_ON_ATTACK_WITH |
| GOLLUM_SCRIPTS | gollum | 1 | ATTACK WITH: GOLLUM_ON_ATTACK_WITH |
| HIDEOUS_TROLL_SCRIPTS | hideous troll, vicious troll | 1 | ATTACK WITH: ON_ATTACK_WITH |
What the player says in quotes is parsed into frames of its own and filed in ORDERS; TALK TO's handler, DO_TALK, gives the character a random number of them up to its limit (slot byte 6), and on its turn one replaces the step it is on, unless that step has bit 6. The whole path, from the quote mark to Thorin opening a chest, is followed on How a sentence is understood. A limit of 0 means the character never listens, and a random 0 means it refuses this time.
Bard's slot takes orders too, but his only ordinary script is BARD_TAKES_ORDER and one step at $C9E2, both with bit 6: no order can interrupt them. Instead the routine parses a waiting order itself and writes its action and objects into that step, which he then tries every turn until it works. So an order to Bard is not done once, on his next turn: it is kept, and carried out as soon as it can be -- which is how SHOOT THE DRAGON is meant to be given. On the tape the step reads: TAKE: wooden chest (an order cannot interrupt it). Because the game rewrites it, SAVE carries its three bytes, and a new game does not put it back (see Bugs).