Open AaronCoplan opened 8 years ago
Explain what is wrong with the current generation, and I will fix it. You don't like the 2x2 and greater open spaces?
Get rid of the open spaces they look dumb
Your code said:
cellMaze[randRow][randCol].setLeftOpening(true); cellMaze[randRow-1][randCol].setRightOpening(true);
Should be:
cellMaze[randRow][randCol].setLeftOpening(true); cellMaze[randRow][randCol+1].setRightOpening(true);
You were modifying the wall state of the wrong cell. I have fixed this in the code and it appears far less buggy - much closer to completion.
you created an our of bounds exception with the getRandomInt method
Works pretty well now - let's improve it and make it smarter so it generates cleaner, more difficult mazes.
This will generate more complex mazes by creating loops and increasing the possibility of multiple solutions.