Prim's Algorithm Maze Generation
Prim's Algorithm
This algorithm creates a new maze from a grid of cells. To begin, choose a random starting cell and add it to the maze (shown in white). Add all adjacent cells to a list of "border cells," shown in light blue in the applet.- Randomly choose a border cell and add it to the maze.
- Randomly choose a wall between the newly added cell and any cell that's already in the maze to remove.
About the Applet
This applet was created using JavaScript and the P5 library. No other libraries/dependencies are required. If you are having trouble viewing the applet, be sure JavaScript is enabled in your browser. Click here for instructions. Internet Explorer is not recommended for this applet.This applet was last updated July 2019.