AaronCoplan / MazeSolver

Program that generates mazes, solves them, has printing capabilities, and can read an image of a maze and solve it.
MIT License
0 stars 1 forks source link

Generate complex mazes by removing walls between cells. #5

Open AaronCoplan opened 8 years ago

AaronCoplan commented 8 years ago

This will generate more complex mazes by creating loops and increasing the possibility of multiple solutions.

stevendbp commented 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?

AaronCoplan commented 8 years ago

Get rid of the open spaces they look dumb

AaronCoplan commented 8 years ago

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.

stevendbp commented 8 years ago

you created an our of bounds exception with the getRandomInt method

AaronCoplan commented 8 years ago

Works pretty well now - let's improve it and make it smarter so it generates cleaner, more difficult mazes.