Safari Guide
The foregoing example moves the player one location towards his destination, and requires that rooms have been visited before. But suppose we wanted to be a bit more lenient about movement, and let the player make as many steps as necessary per turn. We will also show consideration about doors, using the "Locksmith" extension supplied with Inform. (Now every time the code attempts opening a door, unlocking rules will also be invoked.)
Test me with "go to aviary / go to ostrich enclosure / african grasslands".
>(Testing.)
>[1] go to aviary
(heading north)
African Grasslands Exhibit
You can see a bird door here.
(heading north)
(first opening the bird door)
(first unlocking the bird door)
(with the silver key)
Aviary
You can see a bird door here.
>[2] go to ostrich enclosure
(heading west)
Ostrich Enclosure
>[3] african grasslands
(heading east)
Aviary
You can see a bird door here.
(heading south)
African Grasslands Exhibit
You can see a bird door here.
Notice that we continue the movement until one of two things happens: either the player reaches the room that is his destination, or the going attempt doesn't work. In the latter case we stop the action in order to avoid hanging the game up in a loop. This event might occur when the player runs into a locked door, for instance.