sandify
sandify copied to clipboard
mazes!
Adds a new Maze shape that generates drawable mazes for sand tables. Supports four grid types and seven algorithms, with continuous path drawing via Chinese Postman algorithm.
Grid types:
- Rectangle - traditional cartesian grid
- Circle (Polar) - concentric rings with configurable wedge doubling
- Hexagon - pointy-top hex grid
- Triangle - delta grid with alternating triangles
Algorithms:
- Wilson, Backtracker, Prim, Kruskal (all grid types)
- Division, Sidewinder, Eller (rectangle only)
Drawing options:
- Show entry/exit arrows (finds hardest path through maze)
- Show solution path (spline-smoothed)
- Circle mazes: segment or arc walls
- Algorithm-specific tweaks: straightness, horizontal bias, branch level
Technical highlights:
- Unified grid abstraction layer for algorithm portability
- Chinese Postman + Eulerian trail for continuous single-path drawing
Attribution:
- codebox/mazes by Rob Dawson (MIT) - polar/hex/triangle grid implementations
- Jamis Buck's maze algorithms (CC BY-NC-SA 4.0) - Wilson's algorithm reference
- See
src/features/shapes/maze/LICENSEfor full details
Test plan
- [ ] Verify all 4 grid types render correctly
- [ ] Test each algorithm on its supported grid types
- [ ] Verify entry/exit arrows display and connect properly
- [ ] Test solution path rendering with arrows
- [ ] Confirm seed produces reproducible results
- [ ] Test dimension changes update transformer proportionally