technique

Maze Generator

Carve a maze by walking a grid of walled cells with randomized depth-first search: remove the wall into a random unvisited neighbour and recurse.

Also called: DFS maze generation · recursive backtracking maze generation

What it is

How it works

Parameters & tuning

Where it’s been used

Variants & neighbours

Go deeper

Connected to

Further reading: The Coding Train


Revision 1 · 1 source · Something wrong? Tell us.