Maze Program
-
This program tries to find a path from a start position
to the exit (goal positon) in a maze.
-
The method search() is recursively called to find a path to the exit.
-
If the current location is the exit location,
search is successful.
-
Otherwise, search() is recursively applied
to each of the four neighboring locations:
(x - 1, y), (x, y - 1),
(x + 1, y), and (x, y + 1)
if that location has not been visited before.
-
The search fails if there are no paths leading to the exit.
Source Code of the Maze Program
(Graphical Version)
Back
Home