Having trouble expressing this random choice

In my game I’ve set up the following adjectives for my rooms:

A room can be superrocking, rocking or verboten. A room is usually superrocking.

Now, I have a movement rule for moving people around. It includes the following line:

	let target_room be a random rocking room that is adjacent to current actor;
  • where current act is a person who varies.

When I first tested the movement rule, it crashed the game with a runtime error and talk of my interacting with ‘nothing’ variables. So I had the game print out the values of ‘target_room’ and ‘current_actor’ during the rule for test purposes, and I discovered that ‘target_room’ was not being set - its contents were ‘nothing’.

I then discovered that if I removed one of the three elements from the movement rule, it worked.

The elements are 1. random 2. rocking 3. adjacent-ness

So I could specify a random rocking room, or a random adjacent room etc., but not a random rocking room also adjacent to the actor.

How can I express that I want to randomly select a room adjacent to the current actor, and that it must be ‘rocking’? (note that this is always physically possible, no matter where the actor is)

Can it be that there are no rocking rooms in your game? Only superrocking ones?

Ah Felix, you saw through my foolish lies about physical impossibility and pointed me to the nature of the problem.

Then I found another ‘nothing’ problem that was syntax-related, and solved that too.

… So, what happened initially was, when the room default type became superrocking (it used to be plain old rocking), I did not catch all the incidences of the change.