You gimme a maze and I'll show you how to get out of it.
If you cannot get to the destination, I will tell you Your skeleton will lie in the Maze forever.
The maze is actually an unweighted graph with loops. The maze walker finds a solution to the maze using:
BFS
- put all nodes in a queue and pop first nodeDFS
- put all nodes in a stack and pop last nodeDjikstra
- put all nodes in aPriorityQueue
and pop the cheapest node; will yield the same asBFS
since each maze step is same cost
The project has a sample input.txt
.
- Start point is defined with the letter
A
. - End point is defined with the letter
B
. - Maze walls are defined with the letter
X
. - Maze points are split with a space.
- Maze rows are split with
\n
.
A _ _ _ _ _ _ X _ _
_ _ _ _ _ X _ X _ _
_ _ X X X X _ X _ _
_ _ X _ _ X _ X _ _
_ _ X _ _ X _ _ _ _
_ _ X _ _ X _ _ X _
_ _ _ _ _ X _ _ X B
- The maze walker cannot move on the diagonal.
- Some constants are expected in the maze input. See the sample input above.
New constants can be configured in
config.go
- The solution path will contain coordinates of how to get out of the maze
indexed at
[0,0]
in the upper left corner.