Desktop application written in C#, that allows to create and visualize maze generation of various sizes, set by a user, and to find and display shortest path from left top (0,0) to bottom right (Form width, Form height) corner using different path algorithms (Dijkstra, A*, DFS, BFS). Additionaly, the animation speed can be adjusted to suit user's needs, or even disabled at all (Which means only a fully-generated maze will be rendered to the user).
Maze generating algorithm is based on iterative backtracking and it can be represented by this pseudocode:
- Choose the initial cell, mark it as visited and push it to the stack
- While the stack is not empty
- Pop a cell from the stack and make it a current cell
- If the current cell has any neighbours which have not been visited
- Push the current cell to the stack
- Choose one of the unvisited neighbours
- Remove the wall between the current cell and the chosen cell
- Mark the chosen cell as visited and push it to the stack
Project is created with:
.NET Framework 4.7.2
Package OptimizedPriorityQueue 4.2.0 by BlueRaja
To run this project, navigate to the directory where you want to put your repository (Change the test-repo to the location where you want the cloned directory) and use:
cd test-repo
git clone https://github.com/piotr-rzepa/maze-generator-csharp.git
After that, you are able to open project in Microsoft Visual Studio and run Form1.cs to open desktop application 👍.