Skip to content
Randomly.

Library Patterns

Mazes

DFS, Kruskal and Wilson side by side — algorithm as bias.

patterns.maze · v1 · renderer canvas

Result

Randomised DFS: 262 deep, 10% dead ends · Kruskal: 116 deep, 32% dead ends · Wilson's: 121 deep, 28% dead ends

Every one of these is a spanning tree: 480 cells, 479 passages, exactly one route between any two points. They are not drawn from the same distribution. DFS carves until it cannot and then backs up, so its longest route runs 262 cells and only 10% of cells are dead ends; Kruskal leaves 32%; Wilson's leaves 28% and is the only one of the three that is provably uniform over all possible mazes — the other two are biased by their own convenience.

Measurements

Seed receipt

Class C · Observational cached

It was 0.1°C in Yakutsk, Russia, with a 16 km/h wind, when this was made.

Carries only tens of bits of genuine surprise. Always mixed with the OS CSPRNG.

source
Live Weather
observed
2026-09-14T17:21:40+00:00
latency
0ms
mixed with
csprng — always

https://open-meteo.com/en/docs#latitude=62.035&longitude=129.675 ↗

Permalink

The token is the seed, so this link recomputes the result rather than looking it up. No database, and it works for as long as v1 does.

This page and /api/v1/g/patterns.maze run the same code. There is no private endpoint.