🧩 Maze Animator
April 2022
This program generates random mazes for the user to solve manually. The user can also see solutions found via BFS (breadth-first search) or DFS (depth-first search) algorithms. This project was developed for Accelerated Fundamentals of Computer Science 2.
👩🏻💻 Development
This project was meant to teach us about graphs and relevant algorithms. Specifically, we used the concept of a minimum spanning tree to create the mazes, and then solved them using breadth-first and depth-first search.
The program launches and animates the construction of a random maze (Kruskal's algorithm is used to create a minimum spanning tree). After this, the user is able to navigate through the maze via arrow keys, or can watch BFS/DFS solutions via keyboard shortcuts. Statistics are kept to show which solution is optimal.
The user can control the shape of the generated maze, if they wish, by specifying if the maze should have mostly horizontal or mostly vertical edges. The color scheme of the board can also be changed to see vertices based on either their distance from the start or distance from the end, where red signifies being close to the specified point and blue represents being far.
Horizontal-biased maze
Vertical-biased maze
Maze colored by distance from start