Code to solve the "Fox Hole Problem":  http://gurmeet.net/puzzles/fox-in-a-hole/