Well, with help from I6 and Brady Garvin one can: I7: Tables and functional programming Or at least one could ten years ago. I haven’t tried the code in 6M62; my guess would be that the table stuff is sound and some of the property stuff would need tweaking, but that’s not what you care about here.
So you could set up a table with a room-valued column for each direction and then get the column ids of the columns and create a relation of numbers to directions.