Maze puzzle generator
Square, Circular, and Hexagonal Mazes Explained
A maze puzzle generator is more interesting when the shape is a real topology. Maze Foundry supports rectangular grids (including squares), polar circular grids, and hexagonal honeycombs. Each shape has its own adjacency, rendering, and entrance rules. None is a decorative overlay on another.
Rectangular grid geometry
Columns and rows make a matrix. Cell (row, column) has id row × columns + column. Neighbors exist only when the indices stay inside the board. There is no toroidal wrap: the east cell of column 0 is column 1 in the same row, never the last column. Walls are axis-aligned segments. Internal walls are drawn once from the north or west side of a cell so strokes do not double up.
Square-cell adjacency
A square cell has at most four neighbors. Degree 1 is a dead end, degree 2 a corridor, degree 3 or 4 a junction. Example: 7 × 7 First Steps (seed 101) is a small square. 20 × 20 Classic Square (seed 505) is the default workshop. 30 × 15 Wide Passage is rectangular but not square; the graph rules do not change, only the bounding box.
Circular maze structures
A circular maze is a polar grid. Ring 0 is innermost. Each ring has a sector count. At selected ring boundaries the sector count doubles so a parent sector can connect to two children. Reciprocal adjacency is repaired after construction. Rendering uses SVG arcs for circular walls and radial lines for sector walls. Opening a radial passage removes only the matching child arc, not the entire ring.
Concentric rings and angular sectors
Each cell stores inner radius, outer radius, start angle, and end angle. Coordinates: x = centerX + r cos θ, y = centerY + r sin θ. Rings range from 3 to 20. Base sectors range from 4 to 32. Example: Small Orbit, 3 rings, 8 base sectors, seed 1313. Grand Orbit, 16 rings, 6 base sectors, seed 1818.
Radial connections
Moving inward maps a child to floor(sector × innerCount / outerCount). Moving outward can fan into several children. Game pads label these in and out, plus clockwise and counterclockwise. A center goal is an inner-ring cell without an exterior opening. Opposite outer openings punch two outer arcs.
Hexagonal coordinates
Axial pair (q, r) with s = −q − r. Include a cell when max(|q|, |r|, |q+r|) ≤ R. N = 1 + 3R(R+1). Radius 2 → 19 cells. Radius 4 → 61 cells. Radius 10 → 331 cells. Supported radius 2–30.
Six-direction adjacency
Offsets: (1,0), (1,−1), (0,−1), (−1,0), (−1,1), (0,1). Adjacent hexes share exactly one wall. Pointy-top conversion: x = a√3 (q + r/2), y = a·3/2·r. Vertices sit 60° apart to match. The solution polyline crosses those shared walls, not the empty space between hexes that are not neighbors.
The shaded hex is (0,0). Each of the six surrounding cells shares one side with it.
Differences in visual appearance
Rectangles look like puzzle-book pages. Circles look like radial floor plans. Hexes look like honeycombs. Those looks come from geometry, not from a filter. If you export SVG, you can inspect the path data: arcs for circles, six-sided outlines for hexes, orthogonal segments for rectangles.
Entrance and exit placement
Always distinct valid cells. Rectangular custom mode uses boundary cells. Circular outer-to-center uses an outer cell and an inner cell. Hexagonal opposite mode uses axial extremes such as (−R, 0) and (R, 0) when they exist. Random selection uses the seeded generator with a bounded retry so it cannot loop forever on a tiny boundary set.
Choosing a maze shape
Choose rectangular for worksheets and familiar solving. Choose circular when you want angular movement and arc walls. Choose hexagonal when six-way junctions matter. Difficulty labels remain approximate size presets; a radius-8 hex is not “harder” than a 20 × 20 square in any scientific sense. Read the ledger.
Printing different maze layouts
Hex and circular puzzles need more printed diameter for the same cell count because of empty corners in the bounding box. Prefer one puzzle per page for Grand Honeycomb (radius 20, 1,261 cells) or Grand Orbit. Black-and-white prints remain readable because START and FINISH use shape plus text. Use the worksheet builder for rectangles; use Print maze on the shape workshops for polar and hex pages.
When you customize appearance, wall thickness and colors redraw without carving new passages. Cell aspect ratio stretches rectangular cells for wide or tall pages. Puzzle titles are escaped in SVG. Configuration files include shape, dimensions, algorithm, generator version 1.0.0, seed, structural settings, appearance, entrance, and goal. Imports are size-limited and schema-checked. Unknown scripts inside a file are not executed.
If you are choosing a first shape, generate Classic Square (20 × 20, DFS, seed 505), Small Orbit (3 rings), and Honeycomb Starter (radius 2) and look at the three canvases side by side. The statistics panels report real cell counts: 400, the polar sum of sector counts, and 19 hexes. Those numbers are the reason the site is a maze puzzle generator rather than a gallery of illustrations.
FAQ
- Is a circular maze just a warped square?
- No. It is a polar graph with ring and sector indices.
- Why does radius 4 have 61 cells?
- N = 1 + 3×4×5 = 61.
- Can I mix shapes in one worksheet?
- Each worksheet run uses one shape. Generate separate packs for hex or circle pages from their workshops.
Open the maze generator, the circular workshop, or the hexagonal workshop next.