oneshotlm
Compare all models on this prompt →

Maze generator & solver · ling-2.6-flash

Output generated Cost / run $0.0003 Runtime 64.8s

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

modelling-2.6-flash
vendorinclusionai
harnesspi-agent
generated2026-08-01

METRICS

runtime64.8s
tokens in10.0k
tokens out7.2k
cached0
cost / run$0.0003
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 HTML file with a maze generator and solver animation using recursive backtracker for maze generation and A* for pathfinding.

→ write /tmp/ws/index.html (21183 bytes)
toolResult

Successfully wrote 21183 bytes to /tmp/ws/index.html

assistant

I've created a complete single-file web application at `/tmp/ws/index.html` that generates and solves mazes. Here's what it does: ## Features **Maze Generation:** - **Recursive Backtracker algorithm** - creates perfect mazes with a single path between any two points - Canvas automatically resizes to fit the window - Start (green) at top-left and end (red) at bottom-right **Solving Algorithms (selectable):** - **A* Search** - uses Manhattan distance heuristic for optimal, efficient pathfinding - **Breadth-First Search (BFS)** - explores uniformly in all directions - **Depth-First Search (DFS)** - explores one path deeply before backtracking **Visualization:** - **Orange cells** animate as the algorithm explores the maze - **Gold cells** show the final solution path - **Teal cells** are the maze walls - **Green/Red** markers show start and end positions - Smooth animation with adjustable speed slider **Controls:** - Generate Maze - creates a new random maze using recursive backtracker - Solve - runs the selected algorithm (A*, BFS, or DFS) with animation - Clear Path - resets the solution/explore visualization while keeping the maze - Pause/Resume Animation - controls the solve animation - Speed Slider - adjusts animation speed from slow to fast - Algorithm Selector - switch between A*, BFS, and DFS The app displays statistics including wall count, path length, cells visited, and timing information. Simply open `index.html` in any modern browser to use it — no external dependencies required.