A binary matrix \$M\$ representing the walls of a dungeon.
The position \$(x,y)\$ of the player within the dungeon.
The direction \$d\$ that the player is currently facing (0 = North, 1 = East, ...
(inspired by a question over on Code Review)
Suppose two people are playing Hangman, but you've only overheard the game and want to draw the current status.
Given two words as input, where the words ...