Adjacent Rooms



  • Has anyone figured out a way to get a hash of all rooms adjacent to a certain room? Or to check the distance between two rooms?



  • You could make a function that determines adjacent rooms based on the room name.
    If you take North and East as positive axis, South and West as negative you could give each room a x,y coordinate (e.g. W10N5 = -10,5).

    Now you can simply calculate "coordinations" of adjacent rooms and convert it back to a name.