oneshotlm
Compare all models on this prompt →

Maze generator & solver · qwen3-coder

Output generated Cost / run $0.0042 Runtime 84.4s

Prompt for this run

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.

⛨ 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-coder
vendorQwen
harnesspi-agent
generated2026-08-01

METRICS

runtime84.4s
tokens in6.6k
tokens out3.5k
cached6.5k
cost / run$0.0042
Transcript · 4 messages
user

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.

assistant

I'll create a single-page web app that generates a maze using the recursive backtracker algorithm and solves it with A* pathfinding, all in one self-contained HTML file.

→ write index.html (17010 bytes)
toolResult

Successfully wrote 17010 bytes to index.html

assistant

I've created a complete maze generator and solver web application in a single HTML file. Here's what the implementation includes: 1. **Maze Generation**: - Uses the recursive backtracker algorithm to generate a random maze - Each cell has four walls that can be removed to create passages - Visual indication of the generation process 2. **Maze Solving**: - Uses the A* pathfinding algorithm to find the shortest path - Animates the solution path from start to finish - Blue line shows the path being traced 3. **User Interface**: - Generate New Maze button to create a fresh maze - Solve Maze button to find and animate the solution - Visual indicators for start (green) and end (red) points 4. **Technical Features**: - Object-oriented design with Cell and Maze classes - Canvas-based rendering for smooth animations - Responsive design that works in any modern browser - Self-contained in a single HTML file with no external dependencies The application is ready to use - just open the index.html file in any browser. Click "Generate New Maze" to create a new maze, then click "Solve Maze" to see the A* algorithm find the shortest path.