Now With Mazes
BEEN PRETTY BUSY WITH RL over the last week, but found a few hours here and there to work out the code to generate mazes programmatically:
To my surprise, I was able to get something working that actually doesn't look too bad. The algorithm is roughly based on the so-called "sidewinder" algorithm, though with some tweaks. To geek out about this for a minute, it is a pet peeve of mine that every maze-generation algorithm i've ever seen always works on the assumption that the walls have no width, and it takes a lot of hacking and messiness to get them to work with mazes where the walls have width. But anyway, after a lot of hacking and messiness I did get it to work, and it ain't too bad.
EDIT: Forgot to mention press RESET to switch through mazes.
4 Comments
Recommended Comments