oneshotlm
Compare all models on this prompt →

Maze generator & solver · glm-5.2

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 ↗
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
thinking
The user wants a self-contained HTML file with a maze generator (recursive backtracker) and an A-star/BFS solver animation on canvas. Let me build this.

I'll build a self-contained maze app with a recursive-backtracker generator and an animated A* solver.

write /workspace/index.html (25893 bytes)
toolResult

Successfully wrote 25893 bytes to /workspace/index.html

assistant

I've built a complete self-contained maze app in `/workspace/index.html`. Here's what it does: **Generation — Recursive Backtracker** - Carves passages on an odd grid (odd cols/rows so walls align nicely) - Each cell stores wall bits (N/S/E/W); fresh cells start fully walled - A stack-based DFS picks a random unvisited neighbor, knocks down the shared wall, pushes the current cell, and continues; backtracks on dead ends - Animated with the current cell highlighted orange, the backtracking stack shown faintly, and visited cells shaded **Solving — A* or BFS (your choice)** - A* uses a binary min-heap keyed by `f = g + Manhattan-heuristic`, 4-connectivity through open wall directions - BFS uses a simple FIFO queue - Frontier (open set) shown in blue, visited/closed cells in dark blue, reconstructed solution drawn as a glowing orange line - Live stats: visited count, frontier size, path length, elapsed ms **Controls** - Sliders for columns, rows, and animation speed (slow → turbo, which batches more steps/frame) - `Generate` (new maze), `Solve` (animate), `Step` (advance one solver iteration), `Reset solver` - Algorithm dropdown switches between A* and BFS; changing it mid-solve restarts the solver - Canvas auto-fits to viewport and re-renders on resize Open the file in any browser — it runs fully offline with no external dependencies.

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

modelglm-5.2
vendorZ.ai · GLM
harnesspi-agent
generated2026-07-10

EVALUATION

3/5 partial

Maze generated correctly but solver never runs; clicking Solve/Generate buttons wasn't triggered by tested inputs so no animation occurs.

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.

idle motion0.0%
on click0.0%
on drag0.0%
on wheel0.0%
on enter + space0.0%
on arrow keys0.0%
on w/a/s/d0.0%
frame spread13 / 255
console errors0
js errors none

METRICS

runtime104.6s
tokens in1.7k
tokens out7.8k
cached8.7k
cost / run$0.0267