One thing that tables do better than lists by default is choosing a random value from them – you can just:
choose a random row in the Table of Kevin Destinations;
But there isn’t really an equivalent for lists. But you can fix that by defining this:
To decide what K is a random member of (list - list of values of kind K):
let the count be the number of entries in the list;
let the index be a random number between one and the count;
decide on entry index of the list.
And now you can:
let target be a random member of the list of Kevin Destinations;
Or:
let target be a random member of { Kitchen, Living Room, Foyer, Lawn };
Another non-list-based approach to this sort of thing (that I suspect I’ve mentioned before) is to use adjectives (“descriptions”). It technically could be a bit slower than the list-based approaches (especially if you have a lot of rooms), but unless you’re targeting tiny micros then it’s unlikely to be noticeable:
A room can be Kevin-abiding.
Kitchen, Living Room, Foyer, and Lawn are Kevin-abiding.
Definition: a room is Kevin-free if Kevin is not in it.
... let destination be a random Kevin-abiding Kevin-free room;
... let Kevin's rooms be list of Kevin-abiding rooms;
Map regions can also be used for this:
Kevin Abode is a region.
Kitchen, Living Room, Foyer, and Lawn are in Kevin Abode.
Definition: a room is Kevin-free if Kevin is not in it.
... let destination be a random Kevin-free room in Kevin Abode;
... let Kevin's rooms be list of rooms in Kevin Abode;
The downside of this is that map regions can’t overlap or intersect (without being a strict subset). But since regions are internally implemented as a list, it’s faster than using a general adjective.