oneshotlm
Compare all models on this prompt →

Maze generator & solver · glm-5.3

Output generated Cost / run $0.0258 Runtime 43.3s

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

modelglm-5.3
vendorZ.ai · GLM
harnesspi-agent
generated2026-08-27

METRICS

runtime43.3s
tokens in7.1k
tokens out4.3k
cached2.8k
cost / run$0.0258
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
Build a self-contained maze app: canvas rendering, recursive backtracker, then A* animation with visualization.
→ write index.html (13469 bytes)
toolResult

Successfully wrote 13469 bytes to index.html

assistant

Done — `index.html` contains a fully self-contained maze app. **Features:** - **Generation:** Recursive-backtracker (iterative DFS) carves the maze, animated with a moving green "head" and trail; 5 maze sizes (15×15 to 61×61) - **Solvers:** - **A\***: picks the open node with the lowest `f = g + h` (Manhattan heuristic) - **BFS**: plain FIFO frontier expansion - **Animation:** visited cells (indigo), frontier (cyan), then the final path reveals cell-by-cell in gold, with a stats readout (path length, nodes explored) - **Controls:** algorithm selector, maze size, solver speed slider, New Maze / Solve buttons Open `index.html` in any browser — no network or external resources needed.