CS Project 2: Maze Generator
Generate map
Function to initilaize maze before creating it. Need a grid to store cells. Or maybe a vector of vectors. IDK yet
shuffle walls
to randomly order walls for deletion
chambers
initially start off with 100 chambers - use sets to define these (because you need a union these guys when you destroy a wall)
Per iteration
consider the next randomly selected wall that has not been considered before, remove that wall if and only if it seperates two chambers
Finish
once youve iterated through all of the 100 walls, you are done
ShuffleWalls
Shuffle walls to be iterated through
considerWalls()
Considers walls
seperatesTwoChambers(wall, chamber))
checks to see if the wall separates two chambers
generateWallsAndChambers()
returns vector of (dimension squared) sets
go through each wall
put it in a random location in another vector
   Login to remove ads X
Feedback | How-To