The simplest algorithm for solving a maze is to pick between &#x27;left&#x27; or &#x27;right&#x27;; I&#x27;ll pick &#x27;left&#x27;. Then the algorithm is: Whenever you are presented with a choice on which direction to go, then follow the &#x27;left&#x27; wall. In the worst case, you&#x27;ll hit every square and there will be a lot of retracing, but it&#x27;ll get the job done. It&#x27;s the equivalent of bubble sort for solving mazes.<p>(My apologies, to zappo2938, I didn&#x27;t dive into your code, though I did skim it. I didn&#x27;t want to create a new top-level comment about the maze problem.)