Misadventure
The original Adventure allowed the player to type the names of rooms in order to move to them, and it is now not too difficult for us to do the same. Adventure restricted this option to adjacent rooms, but we might want to be a bit more flexible, so we will accept any room:
We should reject movement to the player's current location, or to anywhere he hasn't been and can't see:
The assumption here is that the player does know the names of the rooms adjacent to his current location, even if he hasn't been there yet.
Now for the travel itself. The simplest way to ensure that the usual movement rules will still apply is to convert GO BY NAME into a GO action, and here the best route comes to our aid:
This will allow the player to travel toward rooms he has already visited even if they are several moves away.
Finally, so that the player can also use the names of doors as commands:
And in keeping with the original, we might add to our scenario a rule or two about restrictions on movement, just to test that it's all working right:
Test me with "go to misty cavern / go to dark corridor / go to plover room / go to alcove / go to dark corridor / drop pyramid / go to dark corridor / g / go to alcove / g / go to misty cavern".
You're in a small chamber lit by an eerie green light. An extremely narrow tunnel exits to the west. A dark corridor leads northeast.
>(Testing.)
>[1] go to misty cavern
That noun did not make sense in this context.
>[2] go to dark corridor
(heading northeast)
Dark Room
You're in the dark-room. A corridor leading south is the only exit.
>[3] go to plover room
(heading southwest)
Plover Room
You're in a small chamber lit by an eerie green light. An extremely narrow tunnel exits to the west. A dark corridor leads northeast.
>[4] go to alcove
(heading west)
Alcove
You are in an alcove. A small northwest path seems to widen after a short distance. An extremely tight tunnel leads east. It looks like a very tight squeeze. An eerie light can be seen at the other end.
>[5] go to dark corridor
(heading east)
Something you're carrying won't fit through the tunnel with you. You'd best take inventory and drop something.
You'll have to stop here.
>[6] drop pyramid
Dropped.
>[7] go to dark corridor
(heading east)
Plover Room
You're in a small chamber lit by an eerie green light. An extremely narrow tunnel exits to the west. A dark corridor leads northeast.
You'll have to stop here.
>[8] g
(heading northeast)
Dark Room
You're in the dark-room. A corridor leading south is the only exit.
>[9] go to alcove
(heading southwest)
Plover Room
You're in a small chamber lit by an eerie green light. An extremely narrow tunnel exits to the west. A dark corridor leads northeast.
You'll have to stop here.
>[10] g
(heading west)
Alcove
You are in an alcove. A small northwest path seems to widen after a short distance. An extremely tight tunnel leads east. It looks like a very tight squeeze. An eerie light can be seen at the other end.
You can see a platinum pyramid here.
>[11] go to misty cavern
(heading northwest)
Misty Cavern
You are following a wide path around the outer edge of a large cavern. Far below, through a heavy white mist, strange splashing noises can be heard. The mist rises up through a fissure in the ceiling. The path exits to the south and west.