algo

algo


1- Start with a grid full of walls

2- Pick a cell, mark it as part of the maze

3- Add the walls of the cell to the wall list

4- While where are walls in the list

5- Pick a random wall from the list

6- If the cell on the opposite side inst't in the maze yet

7- Make the wall a passage and mark the cell on the opposite side as part of the maze

8- Add the neighboring walls of the cell to the wall list

9- else remove the wall from the list

Report Page