I am making a maze game. I am trying to make a randomly generated path on a 10x10 matrix from 1,1 to 10,10 that will work and will be efficient and different every time. Any ideas?
Date: 08 Nov 2012 05:11
Number of posts: 6
RSS: New posts
Start with it the code outlining a definitive path, the pseudo code will be it taking a random choice to places around itself until it reaches 10,10. Then make random stuff happen. You want to add stuff to prevent it from hitting itself
The Silver Phantom welcomes you
This binary tree maze carves a path from (1,1) to (9,9). The next possible size with this algorithm places the exit at (11,11). The maze is fairly simple, but very quickly generated.
Let me take this opportunity to delete the bottom and right walls, which don't need to be there if you're using out-of-bounds detection:
It should now be clearer what you'd have to change to expand the maze.