Back

Recursive Backtracker

screen shot

The maze generator project above demonstrates backtracking algorithm.
Starting out with a grid full of cells, it will generally begin at the first cell. While making the maze there is a moving green square that it going to each square starting from the top left of the screen and moves on to a random cell the next move creating the maze. If it gets stuck or hits a dead end it will go back to the last square and finds a path to get to the cells that haven't yet been filled. After all cells are filled and a maze covers the grid it will then begin the solve the maze and find the shortest, quickest route to the other end.

Maze Generator