Robin & Orchid — 14 of 88

Ryan Veeder & Emily Boegheim

Release 4

Section - Exit listing

[totally stole most of this code from the Inform manual's example Bumping Into Walls]

Exit listing is an action applying to nothing.

Understand "exits" and "list exits" as exit listing.

Definition: a direction (called thataway) is viable if the room thataway from the location is a room and

(the door thataway from the location is nothing or the door thataway from the location is revealed and the door thataway from the location is comprehended).

Check going nowhere:

try exit listing instead.

Carry out exit listing:

let count of exits be the number of viable directions;

if the count of exits is 0, say "There is nowhere to go." instead;

if the count of exits is 1, say "From here, the only way out is [list of viable directions].";

otherwise say "From here, you could head [list of viable directions]."

Instead of exit listing in Hall4 when Hall4 is dark:

say "The only exit you can see is south, back down the hallway."