0
Stop walking into walls!
code-golf Other tag suggestions?
Some text-based roguelikes don't let you walk into walls, and give you your move back if you try to. Why do that when you can make the player move in the closest valid direction?
The challenge
Write a program of function that, given a ...