3 Years
Discussion Span
Last Post by iamthwee

Get an idea of a starting point and the destination point.
Once at starting point you can navigate north/south etc to a new location, if the new location is not the destination use recursive call of the function until destination reached. As something cool would be to print out visited paths and print out the path from source to destination ;)


If the maze has an entrance and exit just keep going left and you'll get out.

I beleive your reffering to the left-hand rule... Implementing it is a little bit more involved. There's a condition that all of the walls need to be attached to one another. You put your left hand on a wall, and don't ever take it off, and walk. Since all of the walls are simply connected, you are guerenteed to explore all of the sides of the walls, and you must find the exit if it exists.


I'll start you off

  1. Can I go right?
  2. If so, go right (call itself, go back to 1).
  3. If I can't go right, then can I go straight or left?
  4. If possible, go straight first, otherwise go left.
  5. Otherwise, go back.
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.