It’s not too hard, but it’s a bit different from how it works in the standard library of course, since each direction isn’t an object in PunyInform.
Also, you could look at the code in Library of Horror, which is used to make a robot follow the player around. It checks which direction it has to go, so it can print something like “The robot enters from the east.”
got it, thx. that’s not too much more convoluted than the i6 compass. i just wasn’t sure of the most efficient way to iterate through and test the directions.
Since you mention efficiency, and since efficiency is a major point of PunyInform, I just updated the solution to make it slightly more efficient. (Put the value of location._dir_prop into a local variable).