Maze generator & solver · qwen3.5-plus-02-15
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.
transcript · 4 messages
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.
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 either A* or BFS to solve the maze from start to finish 3. Everything should be in one self-contained index.html file with inline CSS and JS 4. No external resources or CDNs Let me create this file with: - A canvas element for rendering - CSS for styling - JavaScript for: - Maze generation using recursive backtracker - Pathfinding animation (I'll use A* as it's more interesting) - Visual feedback for the solving process
/tmp/ws/index.html (19673 bytes)Successfully wrote 19673 bytes to /tmp/ws/index.html
thinking
I've created a complete self-contained maze generator and solver web app in a single `index.html` file. Here's what it includes: **Features:** 1. **Maze Generation**: Uses the recursive backtracker algorithm to generate a random perfect maze 2. **Three Solving Algorithms**: - **A* Search**: Uses Manhattan distance heuristic for efficient pathfinding - **BFS (Breadth-First Search)**: Guarantees the shortest path - **DFS (Depth-First Search)**: Explores deeply before backtracking 3. **Animated Visualization**: Watch the algorithm explore the maze in real-time 4. **Interactive Controls**: Generate, Solve, and Reset buttons 5. **Color-coded Legend**: Shows what each color represents **Visual Elements:** - Purple walls (#533483) - Dark blue paths (#0f3460) - Red start point (#e94560) - Teal end point (#00d9a5) - Semi-transparent red for visited cells - Yellow for the final solution path The app runs entirely in the browser with no external dependencies.
Done! I've created `index.html` - a self-contained maze generator and solver web app with: **Features:** - **Recursive Backtracker** algorithm for maze generation - **3 solving algorithms**: A* Search (with Manhattan heuristic), BFS, and DFS - **Real-time animation** showing the search progress - **Interactive controls**: Generate, Solve, Reset buttons - **Algorithm selector** dropdown to choose between A*, BFS, or DFS **Visual Design:** - Dark gradient theme with purple walls - Color-coded legend (start, end, walls, visited, solution) - Smooth animations showing the algorithm exploring cells - Status messages showing progress Open `index.html` in a browser to see it in action!
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
EVALUATION
Canvas remains empty in all frames; no maze is ever generated, requiring an untried click on Generate Maze button.
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.