Maze Generation: My Own Algorithm

So, I was fooling around with maze generating, and I happened upon a very strange way to make mazes, albeit, not the most pretty ones! 😉

You can see the source code here

Basically, it works through a branching recursive function that chooses a Y direction at random, but always prioritizes left over right. This leads to fully usable mazes from all my tests with flood filling thus far. I will probably run a tester over a few thousand gens soon to verify, but it appears clean! If anyone wants to take a stab at it, and tell me all the things I did horribly wrong, I’m open for advice 🙂

mazemazeHere’s a picture of one creation of it. As you notice there are many short dead ends which make it not the most aesthetic, but it is actually fully connected!


1 Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s