oneshotlm
Compare all models on this prompt →

Maze generator & solver · kat-coder-air-v2.5

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 · 10 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

write /tmp/ws/index.html (11385 bytes)
toolResult

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

assistant

write /tmp/ws/index.html (17608 bytes)
toolResult

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

assistant

bash {"command":"ls -la /tmp/ws/index.html"}
toolResult

-rw-r--r--. 1 node node 17608 Aug 1 20:20 /tmp/ws/index.html

assistant

bash {"command":"head -20 /tmp/ws/index.html && echo \"...\" && tail -10 /tmp/ws/index.html"}
toolResult

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Maze Generator & Solver</title> <style> * { margin: 0; padding: 0; box-sizing: border-box; } body { background: #0a0a1a; color: #e0e0e0; font-family: 'Segoe UI', system-ui, sans-serif; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; overflow: hidden; } ... document.getElementById('btnNew').addEventListener('click', newMaze); document.getElementById('btnSolve').addEventListener('click', solve); // Initialize initGrid(); generateMaze(); drawMaze(); </script> </body> </html>

assistant

The file is complete and valid. Here's what it does: **Maze Generation (Recursive Backtracker):** - Uses an iterative stack-based approach (no recursion limit issues) - 41×41 grid of cells with walls - Randomly chooses unvisited neighbors, carves passages, backtracks when stuck - Generates a perfect maze (exactly one path between any two cells) **Solvers:** - **A* Search**: Uses Manhattan distance heuristic, prioritizes cells with lowest f-score (g + h) - **BFS**: Explores level-by-level, guarantees shortest path in unweighted grid **Animation:** - Visited cells glow blue as the algorithm explores - Final path animates from green (start) to yellow (end) with glow effect - Speed slider controls how many cells are processed per frame **UI:** - "New Maze" generates a fresh random maze - "Solve" runs the selected algorithm with animated visualization - Legend shows color coding for start/end/visited/path The file is fully self-contained — no external dependencies, runs in any browser.

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

modelkat-coder-air-v2.5
vendorKwaipilot
harnesspi-agent
generated2026-08-01

EVALUATION

3/5 partial

Maze generates and renders well, but solver never triggers since only button clicks (not tested) start it; no keyboard/mouse response shown.

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 spread20.3 / 255
console errors0
js errors none

METRICS

runtime52.2s
tokens in41k
tokens out9.9k
cached31k
cost / run$0.0084