Maze generator & solver · qwen3.6-plus
Generate a random maze with the recursive-backtracker algorithm on a canvas, then animate an A-star or BFS solver finding the path from start to finish.
transcript · 4 messages
Generate a random maze with the recursive-backtracker algorithm on a canvas, then animate an A-star or BFS solver finding the path from start to finish.
thinking
The user wants a single-page web app that: 1. Generates a random maze using the recursive backtracker (DFS) algorithm 2. Animates an A* or BFS solver finding the path from start to finish 3. Everything in one index.html file with inline CSS and JS 4. No external resources or CDNs Let me build this with: - Canvas for rendering - Recursive backtracker for maze generation - A* for solving (more interesting than BFS) - Animation to show the solver working - Nice styling Let me design this carefully: **Maze Generation (Recursive Backtracker):** - Grid of cells, each with walls (top, right, bottom, left) - Start from a random cell, carve passages - Use iterative DFS with a stack to avoid recursion limits **A* Solver:** - Priority queue based on f = g + h - h = Manhattan distance - Animate the exploration and the final path **Rendering:** - Draw maze walls on canvas - Show explored cells with animation - Show final path highlighted - Start and end markers Let me write this out.
/tmp/ws/index.html (12415 bytes)Successfully wrote 12415 bytes to /tmp/ws/index.html
thinking
The file has been created. Let me verify it exists and is well-formed.
Done! `/tmp/ws/index.html` is a fully self-contained single-page app with: - **Recursive Backtracker maze generation** — iterative implementation with animated wall-breaking. Start is top-left (green **S**), end is bottom-right (red **E**). - **A\* solver** — uses Manhattan distance heuristic, animated cell-by-cell. Explored cells get a blue glow, and the final optimal path is highlighted in purple. - **Controls**: adjustable maze size (5–60), animation speed (Slow/Medium/Fast/Instant), Generate, and Solve buttons. - **Live stats**: cells visited during generation/solving and final path length. The maze auto-generates on page load. Open the file in a browser and hit "Solve with A\*" to watch the algorithm work.
TAKE IT TO CODE
A single self-contained HTML file — copy it and open in any browser, or reuse the prompt with your own pi-agent run.
RUN
EVALUATION
Maze generates via recursive backtracker but the automated inputs never triggered the A* solve, so no pathfinding animation was observed.
Vision grade · anthropic/claude-sonnet-5
MEASUREMENTS
Raw readings from the capture, not a verdict — the grade above is the only judgement. Percentages are how much of the screen changed; the measure under-reports sparse motion on a dark background.