Layout where the player is allowed to wander any direction he likes, and the map will arrange itself in order so that he finds the correct "next" location.

Suppose we want to allow the player to wander freely in any direction, but ourselves maintain control over the order in which he encounters the rooms. This sort of effect emphasizes the order of the story-telling over any kind of rigorous simulation of space; on multiple play-throughs, the player might not find all the same rooms in the same locations.

"All Roads Lead to Mars"
Before going a direction (called way) when a room (called next location) is not visited:
   let further place be the room the way from the location;
   if further place is a room, continue the action;
   change the way exit of the location to the next location;
   let reverse be the opposite of the way;
   change the reverse exit of the next location to the location.
The Open Plain is a room. "A wide-open grassy expanse, from which you could really go any way at all."
The Hilly Place is a room. "The grassland gives way to a somewhat more hilly area, though there is still very little to guide you any particular way."
The Stream is a room. "This is the third place you've been today, and so the stream is welcome. How refreshing!"
Test me with "n / s / e / e".
Test me with "n / s / e / e".
Open Plain
A wide-open grassy expanse, from which you could really go any way at all.

>(Testing.)

>[1] n

Hilly Place
The grassland gives way to a somewhat more hilly area, though there is still very little to guide you any particular way.

>[2] s

Open Plain
A wide-open grassy expanse, from which you could really go any way at all.

>[3] e

Stream
This is the third place you've been today, and so the stream is welcome. How refreshing!

>[4] e
You can't go that way.

If we wanted still to be able to find routes between places, we could define a relationship of connection between rooms, which we would add to as we went along.