Randomly Named Rooms?

I’m trying to have rooms named randomly but I’m having trouble implementing it. Here’s what I have:


A room can be named or unnamed. A room is usually unnamed.

A forest chamber is a kind of room.

Table of Forest Names
Name
"Sunny Clearing"
"Quiet Grove"
"Desolate Clearing"
"Dense Thicket"
"Shady Thicket"
"Solemn Clearing"
"Serene Grove"
"Humid Clearing"

To name the forest chambers:
	repeat with destination running through forest chambers:
		if destination is unnamed:
			name destination.
			
To name (destination - a room):
	choose a random row from the Table of Forest Names;
	now the printed name of destination is "[Name entry]".	

When play begins:
        name the forest chambers.

That looks mostly good. You want to make sure you have tabs instead of spaces for the indentation, and you probably want to blank out the table rows when you use them in order to avoid repeating names, and probably mark the rooms named when you name them (just in case you use that again)… and then you just need to create a bunch of forest chambers and you’re good.

[code]A room can be named or unnamed. A room is usually unnamed.

A forest chamber is a kind of room.

Table of Forest Names
Name
“Sunny Clearing”
“Quiet Grove”
“Desolate Clearing”
“Dense Thicket”
“Shady Thicket”
“Solemn Clearing”
“Serene Grove”
“Humid Clearing”

To name the forest chambers:
repeat with destination running through forest chambers:
if destination is unnamed:
name destination.

To name (destination - a room):
choose a random row from the Table of Forest Names;
now the printed name of destination is “[Name entry]”;
blank out the whole row;
now destination is named.

When play begins:
name the forest chambers.

FC1, FC2, FC3, FC4, Heart of the Forest, FC5, FC6, FC7, and FC8 are forest chambers.
Heart of the Forest is named.
FC2 is west of FC1. FC3 is west of FC2. FC4 is west of FC3. Heart of the Forest is west of FC4. FC5 is west of Heart of the Forest. FC6 is west of FC5. FC7 is west of FC6. FC8 is west of FC7. [/code]

Note that, since Heart of the Forest is named, it always winds up in the middle.

[EDITED to include the actual code.]

(Matt, I think something went wrong with your post: you reposted seeva’s code again, instead of your modified version.)

I figured it out! I had the while loop in the wrong place facepalm

facepalm

OK, I’ve edited, though it looks like seeva solved the problem in the meantime!