Skip to content

Latest commit

 

History

History
40 lines (31 loc) · 1.35 KB

README.md

File metadata and controls

40 lines (31 loc) · 1.35 KB

MazeGame_CS

Maze generator Implemented as a console game.


A side project of mine. I tried to apply some graph algorithms that we learned in an algorithm class at the university.
The original purpose was to use short-path finding algorithms to solve the maze.
I implemented the solution using the BFS algorithm as I did not plan to give weights to the edges.
I might want to add features, such as coins, etc, then maybe I'll change the algorithm to Dijkstra.
Next I wanted to implement a randomly generated maze, for this I used a random prim algorithm:

This algorithm is a randomized version of Prim's algorithm.
 1. Start with a grid full of walls.
 2. Pick a cell, mark it as part of the maze. 
    Add the walls of the cell to the wall list.
 3. While there are walls in the list:
 	i) Pick a random wall from the list.
 	   If only one of the two cells that the wall divides is visited, then:
 		   a) Make the wall a passage and mark the unvisited cell 
 			  as part of the maze.
 		   b) Add the neighboring walls of the cell to the wall list.
 	ii) Remove the wall from the list.

The original project was implemented in java and can be found here: https://github.com/maoz-grossman/Maze