oneshotlm
Compare all models on this prompt →

Maze generator & solver · minimax-m2.1

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
thinking
The user wants me to create a single-page web app that:
1. Generates a random maze using the recursive-backtracker algorithm
2. Animates a pathfinding solver (A-star or BFS) finding the path from start to finish

Let me create a self-contained HTML file with:
- Canvas for rendering the maze
- Recursive-backtracker algorithm for maze generation
- A-star or BFS solver with animation
- Start and end points
- Visual representation of the maze, walls, and solution path

I'll write this all in one index.html file with inline CSS and JS.
write /tmp/ws/index.html (16644 bytes)
toolResult

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

assistant
thinking
I've created the maze generator and solver web app. Let me verify the file exists and check its contents to make sure everything is correct.
bash {"command":"ls -la /tmp/ws/index.html"}
toolResult

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

assistant
thinking
The file has been created. Let me verify the content by checking the first few lines and last few lines to make sure the HTML structure is complete.
bash {"command":"head -5 /tmp/ws/index.html && echo \"...\" && tail -5 /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"> ... // Initial maze generation generateMaze(); </script> </body> </html>

assistant
thinking
The file looks complete with proper HTML structure. Let me verify the key components are present by checking for the key functions.
bash {"command":"grep -E \"(generateMaze|aStar|bfs|solveMaze)\" /tmp/ws/index.html | head -10"}
toolResult

<option value="bfs">BFS Algorithm</option> function generateMaze() { function aStar() { function bfs() { async function solveMaze() { result = aStar(); result = bfs(); generateBtn.addEventListener('click', generateMaze); solveBtn.addEventListener('click', solveMaze); generateMaze();

assistant
thinking
All the key functions are present. The file is complete and contains:

1. Recursive-backtracker algorithm for maze generation
2. A* algorithm implementation
3. BFS algorithm implementation
4. Animation of the solver
5. Canvas rendering
6. Start (green) and end (red) points
7. Visited cells shown in orange/yellow
8. Final path shown in blue
9. Controls to generate new maze and choose solver

The web app is fully self-contained in one file with no external dependencies.

Done! I've created a self-contained maze generator and solver web app in `/tmp/ws/index.html`. **Features:** - **Maze Generation**: Uses the recursive-backtracker algorithm to generate a perfect maze (no loops, solvable) - **Two Solvers**: Choose between A* (A-Star) or BFS (Breadth-First Search) algorithms - **Animation**: Watch the solver explore cells (orange) and find the final path (blue) - **Visual Legend**: Shows start (green), end (red), visited cells, and solution path **Controls:** - "Generate Maze" - Creates a new random maze - Dropdown - Select A* or BFS algorithm - "Solve" - Animates the pathfinding The maze is rendered on a 600x600 canvas with a 25x25 grid. Open `index.html` in any browser to use it!

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

modelminimax-m2.1
vendorMiniMax
harnesspi-agent
generated2026-08-01

EVALUATION

3/5 partial

Maze renders correctly with generate/solve UI, but no visible solving path or animation shown in any captured frame, including no reaction to buttons or keys tested.

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 + space18.0%
on arrow keys0.0%
on w/a/s/d0.0%
frame spread13.1 / 255
console errors0
js errors none

METRICS

runtime36.5s
tokens in1.5k
tokens out4.4k
cached22k
cost / run$0.0064