Generate printable mazes
generate_mazesUse this when the user wants printable mazes (maze generator, maze puzzles, maze worksheets, circle maze, hexagon maze) as a PDF with an answer key. Put one object per maze in mazes[] when the mazes differ (shape, difficulty or size, age); for a set of the same kind, set count with shape and difficulty, or pass the child's age. Each maze has a single solution (only one path from Start to Finish, checked by a breadth-first search); the PDF has 1, 2 or 4 mazes per page on Letter or A4, an optional title and name line, and answer pages with the path drawn. Defaults: 1 medium rectangle maze, Letter, 1 per page, name line and answer key on. Does not make picture-shaped mazes, mazes with several solutions, or solve a maze from a photo.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| age | No | Age of the solver; picks the difficulty when none is given (4 and under very easy, 5 to 7 easy, 8 to 10 medium, 11 and up hard). Example: 7 | |
| seed | No | Starting seed; maze N uses seed + N - 1. Reuse it to reprint the same mazes. Example: 2026 | |
| size | No | Grid size for all mazes instead of a difficulty: "columns x rows" (rectangle, hexagon) or rings (circle). Example: "12x16" | |
| count | No | How many mazes when they are all the same kind (1 to 20, default 1). Example: 4 | |
| mazes | No | One object per maze when the mazes differ, e.g. [{"shape":"circle","difficulty":"easy"},{"shape":"rectangle","size":"20x25"}]. Leave out and use count for a set of the same kind. Up to 20. | |
| paper | No | letter (default, US 8.5 x 11 in) or a4. Example: a4 | |
| shape | No | Shape for all mazes: rectangle (default), circle (round theta maze) or hexagon. Example: circle | |
| title | No | Title printed at the top of each page. Example: Space Explorer Mazes | |
| per_page | No | Mazes per printed page: 1 (default), 2 or 4. Example: 2 | |
| algorithm | No | backtracker (default) or wilson. Example: backtracker | |
| name_line | No | Print a Name and Date line on the maze pages (default true). Example: false | |
| answer_key | No | Add answer pages with the solution path drawn (default true). Example: true | |
| difficulty | No | Difficulty for all mazes: very easy, easy, medium (default), hard or expert. Example: easy |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | Yes | ||
| mazes | Yes | ||
| notes | Yes | ||
| pages | Yes | ||
| paper | Yes | ||
| title | Yes | ||
| per_page | Yes | ||
| downloads | Yes | ||
| name_line | Yes | ||
| answer_key | Yes | ||
| maze_count | No | ||
| all_perfect | Yes |