oneshotlm
Compare all models on this prompt →

Maze generator & solver · ling-2.6-1t

Output generated Cost / run $0.0041 Runtime 36.6s

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-1t
vendorinclusionai
harnesspi-agent
generated2026-08-01

METRICS

runtime36.6s
tokens in8.4k
tokens out5.5k
cached0
cost / run$0.0041
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 random maze using the recursive backtracker algorithm and animates an A* solver finding the path from start to finish.

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

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

assistant

I've created a complete single-page web app that implements: ## Features 1. **Maze Generation** - Uses the recursive-backtracker algorithm (depth-first search with backtracking) to generate perfect mazes 2. **Pathfinding** - A* algorithm with Manhattan distance heuristic to find the optimal path from start (top-left) to end (bottom-right) 3. **Visualization** - Step-by-step animation of both generation and solving processes ## Visual Design - **Dark gradient background** with a modern, tech-inspired aesthetic - **Color-coded elements**: - Green: Start cell (S) - Red: End cell (E) - Blue: Visited cells during solving - Yellow: Final path - Dark purple: Walls - **Responsive layout** that works on mobile devices ## Controls - **Generate Maze**: Creates a new random maze using recursive backtracker - **Solve Maze**: Animates A* finding the optimal path - **Reset**: Clears everything and returns to initial state ## Statistics Display - Cells visited during solving - Path length found - Current status messages The A* algorithm guarantees finding the shortest path by using a heuristic (Manhattan distance) to prioritize exploring cells that are likely closer to the goal, making it more efficient than plain BFS while still guaranteeing optimality.