oneshotlm
Compare all models on this prompt →

Maze generator & solver · qwen3.6-35b-a3b

Output generated Cost / run $0.0038 Runtime 50.0s

Prompt for this run

Build a maze generator and solver visualization on a canvas. Use HTML, CSS, and JavaScript as needed. Write it to `index.html` in the current working directory using your file tools. Inline your own CSS and JavaScript. Do not use external assets, CDNs, or network requests. No third-party libraries are provided. Required behavior: - Generate a 25 by 15 cell rectangular maze using randomized recursive backtracking. All cells must be reachable, with exactly one simple path between any pair of cells. - Use the upper-left cell as Start and lower-right as Finish. Draw cell walls clearly and animate generation so carving progress is visible. - After generation finishes, animate either BFS or A-star exploring the maze, then highlight the complete path from Start to Finish. The path must cross only open passages. - Provide New Maze and Replay Solver. New Maze cancels the previous animation and generates a fresh maze; Replay Solver uses the existing maze without changing its walls. - Mark start, finish, exploration, and solution with distinguishable styles and a short legend. Verify: Inspect maze-carving progress and request New Maze while animation is active. Check that the new generation replaces the previous view cleanly. If the solver starts during inspection, check that its visible steps follow open passages.

⛨ sandboxed Open in new tab ↗

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

modelqwen3.6-35b-a3b
vendorQwen
harnesspi 0.87.1 · browser iteration
generated2026-10-14

METRICS

runtime50.0s
tokens in11k
tokens out4.6k
cached0
cost / run$0.0038
Transcript · 7 messages
system

user

Build a maze generator and solver visualization on a canvas. Use HTML, CSS, and JavaScript as needed. Write it to `index.html` in the current working directory using your file tools. Inline your own CSS and JavaScript. Do not use external assets, CDNs, or network requests. No third-party libraries are provided. Required behavior: - Generate a 25 by 15 cell rectangular maze using randomized recursive backtracking. All cells must be reachable, with exactly one simple path between any pair of cells. - Use the upper-left cell as Start and lower-right as Finish. Draw cell walls clearly and animate generation so carving progress is visible. - After generation finishes, animate either BFS or A-star exploring the maze, then highlight the complete path from Start to Finish. The path must cross only open passages. - Provide New Maze and Replay Solver. New Maze cancels the previous animation and generates a fresh maze; Replay Solver uses the existing maze without changing its walls. - Mark start, finish, exploration, and solution with distinguishable styles and a short legend. Verify: Inspect maze-carving progress and request New Maze while animation is active. Check that the new generation replaces the previous view cleanly. If the solver starts during inspection, check that its visible steps follow open passages.

assistant
thinking
The user wants me to build a maze generator and solver visualization as a single self-contained HTML file. Let me plan this out:

1. **Maze Generation**: Randomized recursive backtracking (DFS) on a 25x15 grid
2. **Maze Solver**: BFS or A* algorithm
3. **Visualizations**: 
   - Animated generation (carving progress visible)
   - Animated solver (BFS exploring cells)
   - Solution path highlighted
4. **Controls**: New Maze, Replay Solver
5. **Legend**: Start, Finish, Exploration, Solution

Let me build this step by step and write it to `index.html`.

Key design decisions:
- Canvas-based rendering
- Recursive backtracking with async/await for animation
- BFS for solver (simpler to visualize clearly)
- Cell walls: draw walls, carve by removing them
- Colors: Start (green), Finish (red), Exploration (blue), Solution (gold)

Let me write the complete file.
→ write /tmp/job-c8ZsOf/index.html (12522 bytes)
toolResult

Successfully wrote to /tmp/job-c8ZsOf/index.html

assistant
thinking
Good, the file is written. Now let me inspect it in the browser to verify the initial output and check the console.

Now let me open it in the browser and inspect:

→ browser {"action":"screenshot"}
toolResult

Frame 1, +0ms

[Browser image supplied to model]

{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing."],"dom":"Maze Generator & Solver\nNew Maze\nReplay Solver\nStart\nFinish\nExplored\nSolution Path\nUnvisited\nPress \"New Maze\" to begin.","images":"attached"}

assistant
thinking
The maze is generated correctly - 25x15 grid with walls visible. Let me test the New Maze button and Replay Solver functionality. I'll click New Maze while the animation is active to verify clean replacement.

Maze generation looks correct - 25x15 grid with walls. Let me test the New Maze button and Replay Solver: