What determines the list of visited rooms? It doesn’t appear to match the order in which I traveled through the rooms… I assume it has to do with the order in which they are listed in some array? Is there a way to go through them in the order in which I visited them?
Carry out playlisting:
say "The playlist of rooms you have visited is: [paragraph break]";
repeat with item running through the list of visited rooms:
if song title of the item is "":
say "[item] has no song yet!";
otherwise:
say "[item]: [song title of item][line break]";
The rooms are stored in (effectively) an immutable linked list in memory, and each one has a flag saying whether it’s visited or not. When you iterate through visited rooms, Inform runs through that linked list and returns all the ones with the flag set. So the order will be the order they’re defined in the source code, not the order the player visited them.
If you want to keep track of that, you’ll need to use your own data structure.
The visited list is a list of objects that varies.
After going to a room:
add the location to the visited list, if absent;
continue the action.