"randomdir" by Andrew Schultz room 1 is a room. "[dir-room-list]" room 2 is a room. "[dir-room-list]" abc is a direction that varies. when play begins: say "This is a random direction maker made with the help of example #125 in the Inform documents, aka 'Bee Chambers.' It's not very elegant, but we'll worry about that later. I tried to use a list first time, but it didn't work. Also, I realize that you could possibly have directions overwrite each other. I don't know a way around this if you want to use a wider span of directions than N/NW/W, say--or I do, but I'm too lazy to write a While loop. The direction code is from example 103, 'Bumping into Walls.'"; repeat through the table of random room relations: let X be a random number between start entry and end entry; if X > 8: now X is X - 8; if X is 1: now first-room entry is mapped north of second-room entry; now second-room entry is mapped south of first-room entry; if X is 2: now first-room entry is mapped northwest of second-room entry; now second-room entry is mapped southeast of first-room entry; if X is 3: now first-room entry is mapped west of second-room entry; now second-room entry is mapped east of first-room entry; if X is 4: now first-room entry is mapped southwest of second-room entry; now second-room entry is mapped northeast of first-room entry; if X is 5: now first-room entry is mapped south of second-room entry; now second-room entry is mapped north of first-room entry; if X is 6: now first-room entry is mapped southeast of second-room entry; now second-room entry is mapped northwest of first-room entry; if X is 7: now first-room entry is mapped east of second-room entry; now second-room entry is mapped west of first-room entry; if X is 8: now first-room entry is mapped northeast of second-room entry; now second-room entry is mapped southwest of first-room entry; [ Here's code I tried at first but modified later: (obviously I am in trouble if you don't want a range of directions) let L be a list of directions; let L be { north, northwest, west, southwest, south, southeast, east, northeast }; let X be a random number between start entry and end entry; now abc is entry X of L; now room 1 is mapped abc of room 2;] table of random room relations start end first-room second-room 1 3 room 1 room 2 Definition: a direction (called thataway) is viable if the room thataway from the location is a room. to say dir-room-list: repeat with Q running through list of viable directions: say "[the room Q from location of player] is [Q]."; [Now we build in the instruction for what Inform should say if the player tries to head in a direction that leads nowhere:] Instead of going nowhere: let count of exits be the number of viable directions; if the count of exits is 0, say "You appear to be trapped in here." instead; if the count of exits is 1, say "From here, the only way out is [list of viable directions]."; otherwise say "From here, the viable exits are [list of viable directions]." [There is no theoretical reason why we have to define "count of exits" here: we could, if we wanted, just say "if the number of viable directions is 0", "if the number of viable directions is 1", and so on. However, each calculation of a "viable direction" takes a bit of computing power, so there is some slight savings in not requiring the game to count viable directions more than once in this routine.]