I have recently been playing around with the idea of generating mazes. This is mostly due to the tower defence game I am working on and generating mazes is a very interesting topic. I have decided to start by implementing the Recursive Backtracker algorithm as it seemed both easy to implement and I like the mazes produced by it. By far the best resource I found while learning about mazes was a blog by Jamis Buck and his book “Mazes for Programmers”.


You can see my implementation of the Recursive Backtracker algorithm below.

Maze Seed:


The code is all on my Github