Randomly generated mazes.

Control the purple cursor with arrow-keys to reach the green exit. Reload the page to generate a new maze.

You can change the maze generation and visualization using the following URL query parameters:

builder
Which maze builder algorithm to use. Possible values are:

division
Recursive division algorithm
prim
Iterative randomized Prim's algorithm
visualize
Set this to watch the maze being generated. (Does not require a value.)
speed
Canvas paint loop delay in milliseconds. Only useful in combination with visualize to slow down the animation even more. If visualize is set, the default value is 150 milliseconds, otherwise the default is 0.
gridSize
The size of a single grid cell on the canvas. The value is a percentage of the canvas width or heigth (whichever is smaller). Default is 3.
hideEntryExit
Can be used to hide the entry and exit symbols. Useful if you want to save the generated image for other purposes. (Does not require a value.)
color
The color of the walls. Default is #cc9900. This can be any valid CSS color string.

Be aware, that for hexadecimal values with a leading hash (#), the hash has to be escaped as %23 in the URL. For example ?color=%23a0522d (for #a0522d).

Example A – Generate static black and white maze without icons:
maze.htm?builder=prim&color=black

Example B:
maze.htm?builder=division&visualize&gridSize=2&color=darkred