Trains and cabs
Sherlock has two kinds of public transport. Trains run to a timetable whether or not you are there: eight steam trains circle the underground stations and run the Leatherhead line. Hansom cabs are the opposite: they stand off stage until somebody hails one, and they go nowhere unless they are told to. Both are ordinary things that hold other things, so a passenger is simply something inside the vehicle, and when the vehicle moves everything in it moves too.
The short answers
- How does a timetable work? Each train is an actor (9860) running a short plan script that says "put the train in room X, then wait N minutes", over and over. The timetable is that script: the waits add up to a 30-minute circuit for the underground and a 3-hour circuit for the Leatherhead line. Where each train starts in the cycle is just which instruction its actor-table entry points at.
- How does a train get from station to station? One action record (E4C9) puts the train in the next room with the move routine at DD0E, and makes the train visible at a platform and invisible between stations. There is no track and no distance: a journey is a number of minutes spent in a "between stations" room.
- Do cabs move when they are not hailed? No. An unhailed cab is in room 0, off stage, and its cabbie only runs a do-nothing loop (F2B2). A cab moves only when somebody hails it. In the first minutes of the game Lestrade hails cab 30 in Parliament Street and rides it to Kings Cross Road; until 3pm that is the only cab movement in a game where the player does nothing. After that Phipps, the Major and the German agent take cabs as part of their flights.
The things and rooms involved
| What | Thing or room numbers | Notes |
|---|---|---|
| Underground trains | things 36 to 41 (actors 36 to 41) | Three run one way round the platform-one stations and three the other way round the platform-two stations. |
| Leatherhead trains | things 42 and 43 (actors 42 and 43) | Two trains on the same three-hour circuit, half a circuit apart. |
| Hansom cabs and cabbies | cab 30 with cabbie 31; cab 33 with cabbie 34 | The cabbie is always the next number after his cab (9B50 relies on it). Both cabbies are actors (9860). |
| Police cab | thing 109, room 105 (8B65) | Driven by the local police man. It has only three routes (9AA3). |
| Rooms for a train in motion | room 2 (84F5) for the underground; rooms 3 (84FF) and 4 (8509) for the Leatherhead line | These are the "between stations" rooms. A passenger's own room number becomes the room the train is in. |
| Room for a cab in motion | room 1 (84EB) | The hansom cab: the cab is put here for the length of the ride, then moved to the destination. |
| Station rooms | Aldergate 15 (platforms 16, 17); Kings Cross 19 (platforms 20, 21 underground and 22, 23 Leatherhead); Paddington 25 (26, 27); Victoria 29 (30, 31); Leatherhead 53 (54, 55) | A station room has no description of its own; the trains stop only in the platform rooms. |
How a timetable is written
Every actor has an eight-byte record in the actor table (9860): its thing number, the position in its plan script (+1/+2), the plan registers, and the minute at which it next acts (+6/+7). Once per turn the main loop (A064) walks the table; an actor whose minute has come runs one step of its script (CC78), and the step's duration decides when it next acts. A train's script is built from two instructions only:
- DO 140 room, minutes, four bytes such as
$02,$8C,$10,$03, is "put the train in room $10 and wait 3 minutes". It is a call of the sub-script at F2A5, which runs the move record (E4C9) and then the wait record (DDBE). - RUN DDBE minutes, five bytes such as
$07,$BE,$DD,$3C,$FF, is a plain wait (here 60 minutes) with the train left where it is.
A GOTO ($0E) at the end sends the script back to its start, and a PASS ($0F) is a one-minute pause. Because the waits are the only thing that spends time, adding up the minutes gives the timetable exactly.
The underground: two circuits of 30 minutes
Six trains share two scripts. The first circuit (F21D to F243) calls at the platform-one stations in the order Aldergate, Kings Cross, Paddington, Victoria; the second (F246 to F275) goes the other way round the platform-two stations: Kings Cross, Aldergate, Victoria, Paddington. Each train is a different distance round the same script because its actor-table entry points at a different instruction, so the three trains on a circuit are spread round it: ten minutes apart on the platform-one circuit, and nine, nine and twelve minutes apart on the platform-two circuit.
| Step | Platform-one circuit: where the train is | Minutes | Start of the day |
|---|---|---|---|
| 1 | Aldergate platform one (85AE) | 3 | actor 36 starts here |
| 2 | between stations (room 2, 84F5) | 3 | |
| 3 | Kings Cross platform one (85E8) | 3 | |
| 4 | between stations (room 2, 84F5) | 1 | |
| 5 | waits where it is (in the same room as before) | 2 | actor 38 starts here |
| 6 | Paddington platform one (8642) | 4 | |
| 7 | between stations (room 2, 84F5) | 4 | |
| 8 | waits where it is (in the same room as before) | 1 | actor 37 starts here |
| 9 | Victoria platform one (867C) | 4 | |
| 10 | between stations (room 2, 84F5) | 5 | |
| Whole circuit | 30 |
| Step | Platform-two circuit: where the train is | Minutes | Start of the day |
|---|---|---|---|
| 1 | waits where it is (in the same room as before) | 2 | actor 39 starts here |
| 2 | Kings Cross platform two (85F8) | 3 | |
| 3 | between stations (room 2, 84F5) | 3 | |
| 4 | Aldergate platform two (85BE) | 3 | |
| 5 | between stations (room 2, 84F5) | 1 | |
| 6 | waits where it is (in the same room as before) | 4 | actor 41 starts here |
| 7 | Victoria platform two (868C) | 4 | |
| 8 | between stations (room 2, 84F5) | 1 | |
| 9 | waits where it is (in the same room as before) | 4 | actor 40 starts here |
| 10 | Paddington platform two (8652) | 4 | |
| 11 | between stations (room 2, 84F5) | 1 | |
| Whole circuit | 30 |
From the start of the game (8:00am) a train reaches each platform-one platform every ten minutes. Each platform-two platform gets three trains in every 30 minutes, nine, nine and twelve minutes apart. A train stays three or four minutes. The first arrivals:
| Platform | Trains arrive at |
|---|---|
| Aldergate platform one (85AE) | 8:00am, 8:10am, 8:20am, 8:30am, 8:40am, 8:50am ... |
| Kings Cross platform one (85E8) | 8:06am, 8:16am, 8:26am, 8:36am, 8:46am, 8:56am ... |
| Paddington platform one (8642) | 8:02am, 8:12am, 8:22am, 8:32am, 8:42am, 8:52am ... |
| Victoria platform one (867C) | 8:01am, 8:11am, 8:21am, 8:31am, 8:41am, 8:51am ... |
| Kings Cross platform two (85F8) | 8:02am, 8:11am, 8:20am, 8:32am, 8:41am, 8:50am ... |
| Aldergate platform two (85BE) | 8:08am, 8:17am, 8:26am, 8:38am, 8:47am, 8:56am ... |
| Victoria platform two (868C) | 8:04am, 8:16am, 8:25am, 8:34am, 8:46am, 8:55am ... |
| Paddington platform two (8652) | 8:04am, 8:13am, 8:25am, 8:34am, 8:43am, 8:55am ... |
The ride from one platform to the next is three or five minutes, depending on the stretch (the platform-one train takes 3 from Aldergate to Kings Cross, 3 on to Paddington, 5 on to Victoria and 5 back to Aldergate).
The Leatherhead line: one circuit of three hours
The two Leatherhead trains run the same script (F278 to F2A2) from different starting points. A train stops at Kings Cross platform four, shunts to platform three, then spends 65 minutes on the line in room 3, and does the same at Leatherhead (platforms one and two) before the long run back.
| Step | Where the train is | Minutes | Start of the day |
|---|---|---|---|
| 1 | waits where it is (in the same room as before) | 60 | actor 42 starts here |
| 2 | Kings Cross platform four (8618) | 10 | |
| 3 | between stations (room 4, 8509) | 5 | |
| 4 | Kings Cross platform three (8608) | 10 | |
| 5 | between stations (room 3, 84FF) | 5 | |
| 6 | waits where it is (in the same room as before) | 60 | actor 43 starts here |
| 7 | Leatherhead platform one (87FC) | 10 | |
| 8 | between stations (room 4, 8509) | 5 | |
| 9 | Leatherhead platform two (880C) | 10 | |
| 10 | between stations (room 3, 84FF) | 5 | |
| Whole circuit | 180 |
The two trains are half a circuit apart, so a train arrives at each platform every 90 minutes:
| Platform | Trains arrive at |
|---|---|
| Kings Cross platform four (8618) | 9:00am, 10:30am, 12:00pm, 1:30pm, 3:00pm, 4:30pm, 6:00pm, 7:30pm ... |
| Kings Cross platform three (8608) | 9:15am, 10:45am, 12:15pm, 1:45pm, 3:15pm, 4:45pm, 6:15pm, 7:45pm ... |
| Leatherhead platform one (87FC) | 9:00am, 10:30am, 12:00pm, 1:30pm, 3:00pm, 4:30pm, 6:00pm, 7:30pm ... |
| Leatherhead platform two (880C) | 9:15am, 10:45am, 12:15pm, 1:45pm, 3:15pm, 4:45pm, 6:15pm, 7:45pm ... |
The journey from Kings Cross platform three to Leatherhead takes 65 minutes. A passenger who stays on the train is carried on: at the end of a stop the train moves to the other platform of the same station, so riding on from Leatherhead platform one takes you to platform two, five minutes later, by way of the between-stations room 4 (you cannot get out there). This timetable decides the endgame chase. Phipps boards the train that leaves Leatherhead platform two at 4:55pm, and the next one is 90 minutes behind it (E7E7).
How a train moves from station to station
The move is one action record, "put a train in a room" (E4C9, internal verb 140). It does four things:
- Takes the room number from the direct object ($A034). If it is room 2, 3 or 4, the train is about to leave a station, so it prints THE TRAIN PULLS OUT OF THE STATION. (7611) and uses the routine that clears the train's revealed bit (+5 bit 7, 9C60). Otherwise it uses the routine that sets it (9C56). A train is therefore visible at a platform and invisible between stations: the visibility test (C821) refuses anything without that bit.
- Moves the train, with everything inside it, to the room (DD0E). The move updates the +15 room byte of the train and of each passenger, and the player's own room, so a passenger's room number follows the train: 23, then 4, then 22, then 3 on the first stage of the Leatherhead run.
- Clears bit 6 of the new room's record (the "visited" bit), so the room description is shown in full again.
- Returns "done"; the script then waits the stated minutes.
Everything a train prints is shown only when the player can see it. Before each actor's turn the engine switches printing off (CC61) and switches it on only if the actor and the player can see each other (C821), so a train pulling out on the other side of London is silent. When a train arrives at your platform the move narration prints A STEAM TRAIN ENTERS.
Getting on and off
CLIMB INTO TRAIN works like getting into any container, and needs the train to be visible, which means it is at your platform. While you are aboard the room description reads "You are in a steam train" plus the platform or, between stations, "riding in a steam train through the picturesque English countryside". GET OUT OF TRAIN is refused between stations (the message is YOU CANNOT GET OUT OF THE STEAM TRAIN.); at a platform it works. Characters who follow you, such as Watson and Lestrade, climb in after you with the "follow" script (E476), and a train that carries Lestrade is described with him in it.
Hansom cabs
Where a cab is, and how it is hailed
At the start of the game both cabs are off stage, in room 0. The HAIL action (E2C7, shared action AA71 entry 11) works only if all of these hold (the pre-check at E298):
- the direct object is cab 30 or cab 33;
- the room you are in is one of the ten cab stands, which means there is a cab journey from here (9C07);
- the cab is in room 0, so it is not already on a job; and
- the cabbie is free (CFB9).
The action then puts the cab in your room (DD0E), remembers which cab it is (E2C6), and starts the cabbie on the fare script at F2B6 with you and the cab as its two objects (E2EE).
What the cabbie does
The cabbie is an actor with the script at F2B2. Its first two instructions are a PASS and a GOTO back to itself, so an unhailed cabbie does nothing for ever. HAIL gives him a second entry point to run, with these stages:
- Greeting and waiting. He says GOOD MORNING GUV'NOR (6BAC) and starts a countdown of 4 minutes plus a random 0 to 4 (E52F). Each minute he checks whether you are there (F2C2); if you are, he moves on to the next stage. If you are not, he ticks the countdown (E57A), and when it runs out he prints WITH A PRACTISED FLICK OF THE REINS, YOU MOVES ON DOWN THE STREET IN SEARCH OF OTHER FARES. (6BF6) and puts the cab back in room 0 (F376).
- Waiting for a destination. While you are there he waits for a "go to" order, re-asking WELL ARE WE GOIN' ANYWHERE GUV'NOR? (6C1B) whenever a countdown (5 plus a random 0 to 3 minutes) runs out, and then starting again from the first stage. An order is SAY TO CABBIE "GO TO ..." or "GO FURIOUSLY TO ...".
- The ride. See below.
- Payment. When the ride ends the cabbie names the fare (RIGHT GUV'NOR THAT WILL BE 10D., E6BC). If you stay in the cab without paying he repeats it about every six minutes (a countdown of 5 plus a random 0 to 2 minutes), and the cab never drives off with you. If you get out without paying the cabbie, who now appears to be getting quite agitated, says WHAT ABOUT ME MONEY GUV'NOR? (message 6BC7), and if you then walk away he shouts after you (E70E, message 6C54): YOU BLOODY SNOB, WATCH OUT IF WE EVER MEET AGAIN. Then he puts the cab back in room 0 (F376) and goes back to his idle loop. Nothing else follows from not paying: he does not chase you, and nothing in the cabbie's script punishes you further. Once the account is settled, or change is given, the script moves on the same way.
Whether a fare is owed is kept in the cabbie's purse: the ride makes his balance negative by the fare, so "negative" means a fare is owed, "positive" means change is due and zero means settled (E63E, E654, E66F).
The ride
A ride is two shared actions, one for each speed. GO TO (9AF4, shared action 14) and GO FURIOUSLY TO (9AE1, shared action 15) both do the same things:
- Check that the cab can get there from where it stands (9B50): look for a journey between the two rooms in the journey table (9B7F, searched either way round by 9C07). If there is none, the cabbie says SORRY GUV'NOR I CANNOT GET THERE FROM 'ERE.
- Price the ride (9B25): the fare is the rate times (the journey's minutes divided by 5, rounded down, plus 1). GO TO charges 2d a step and GO FURIOUSLY TO 6d. Baker Street to Parliament Street is 20 minutes, so 2 × 5 = 10d. The fare is taken off the cabbie's purse.
- Set the length of the action to the journey's minutes. Going furiously takes two minutes off, so the ride is two minutes quicker but three times dearer.
- Put the cab in room 1 (the hansom cab) and make it invisible (9C60), then hand the ride to the vehicle sub-script at F3AD, which, when the minutes have passed, moves the cab and everything in it to the destination (9C41) and makes it visible again.
So a cab ride does not pass through the streets in between: the cab sits in room 1 for the journey time, then appears at the destination.
The journey table
There are ten cab stands, all street rooms, and every pair has an entry: 45 in all (9B7F). Leatherhead and Old Mill Road are not in it. They are reached by train and by the police cab. The minutes for each pair:
| Portman St | Baker St | Parliament St | Slater St | Aldergate St | Kings Cross Rd | Bishops Rd | Buckingham Palace Rd | Camden St | Sidmouth St | |
|---|---|---|---|---|---|---|---|---|---|---|
| Portman St | – | 3 | 7 | 20 | 19 | 18 | 7 | 12 | 6 | 13 |
| Baker St | 3 | – | 20 | 25 | 26 | 12 | 6 | 15 | 24 | 9 |
| Parliament St | 7 | 20 | – | 18 | 18 | 12 | 19 | 2 | 4 | 15 |
| Slater St | 20 | 25 | 18 | – | 3 | 20 | 30 | 20 | 17 | 25 |
| Aldergate St | 19 | 26 | 18 | 3 | – | 13 | 28 | 17 | 9 | 11 |
| Kings Cross Rd | 18 | 12 | 12 | 20 | 13 | – | 11 | 16 | 18 | 3 |
| Bishops Rd | 7 | 6 | 19 | 30 | 28 | 11 | – | 15 | 24 | 13 |
| Buckingham Palace Rd | 12 | 15 | 2 | 20 | 17 | 16 | 15 | – | 12 | 19 |
| Camden St | 6 | 24 | 4 | 17 | 9 | 18 | 24 | 12 | – | 22 |
| Sidmouth St | 13 | 9 | 15 | 25 | 11 | 3 | 13 | 19 | 22 | – |
Fares at the normal rate are 2d for each full five minutes plus 2d: 3 minutes costs 2d, 6 to 9 minutes 4d, 20 minutes 10d, 30 minutes 14d.
The police cab
The police cab (thing 109, with the room 105 inside) is driven by the local police man and has only three routes (9AA3): Old Mill Road to Main Street, Main Street to Old Mill Road and Main Street to Kings Cross Road. A plain GO TO (9A99) takes 20 minutes longer than GO FURIOUSLY TO (shared action 2): the run out to Old Mill Road takes 114 minutes by plain GO TO and 94 going furiously. It is the only way to Old Mill Road, which is why the endgame needs it.
Do cabs move when they are not hailed?
No. A cab that has not been hailed is off stage in room 0 and cannot be seen or reached. Its cabbie runs the do-nothing loop at F2B2, so no cabbie ever leaves on his own and no cab ever wanders the streets. The same holds after a ride: when the fare has been dealt with the cab goes back to room 0. A cab is only ever in a street because someone hailed it, and that someone can be a character as well as you: Lestrade hails cab 30 at the start of the game (the action is the same HAIL, run by actor 2) and rides it from Parliament Street to Kings Cross Road, arriving at about 8:16am, after which the cab goes back to room 0. Other characters use cabs the same way: Phipps and the Major each run the cab-hailing sub-script in their own plans, and the German agent runs Phipps's flight code, which includes it, and Lestrade's own cab sub-script is at EBA4. Cab 33 stays in room 0 until somebody hails it.
The trains are different in exactly this respect: they never stand idle, and a train you cannot see (between stations, or at a platform in another part of London) is still running its script.