Tetris · glm-4.7
Build a playable Tetris on a canvas with all seven tetrominoes, rotation, line clears, increasing speed, a next-piece preview, and score.
transcript · 4 messages
Build a playable Tetris on a canvas with all seven tetrominoes, rotation, line clears, increasing speed, a next-piece preview, and score.
thinking
The user wants me to build a complete Tetris game in a single HTML file. Let me plan out what I need: 1. HTML structure with a canvas 2. CSS for styling 3. JavaScript for the game logic including: - All seven tetrominoes (I, O, T, S, Z, J, L) - Rotation system (wall kicks ideally, but basic rotation should work) - Line clearing with scoring - Increasing speed as levels progress - Next piece preview - Score tracking - Game over detection - Controls (arrow keys) Let me write this all in one self-contained index.html file.
I'll create a complete Tetris game in a single HTML file with all the requested features. Let me build this:
/workspace/index.html (21510 bytes)Successfully wrote 21510 bytes to /workspace/index.html
thinking
I've created a complete Tetris game in a single HTML file. Let me verify the file was created properly and maybe test it briefly if needed.
I've created a fully playable Tetris game in `index.html` with all the requested features: **Features included:** - ✅ **All 7 tetrominoes** (I, O, T, S, Z, J, L) with distinct colors - ✅ **Rotation** with wall kick support for smooth gameplay - ✅ **Line clears** with proper scoring (100/300/500/800 points for 1/2/3/4 lines) - ✅ **Increasing speed** - level increases every 10 lines, drop speed increases accordingly - ✅ **Next-piece preview** shown in a side panel - ✅ **Score tracking** - displays score, level, and lines cleared - ✅ **Ghost piece** - shows where the piece will land - ✅ **Hard drop** (Space bar) for instant placement - ✅ **Soft drop** (Down arrow) for faster descent - ✅ **Pause** (P key) functionality - ✅ **Game over** detection with restart option - ✅ **Bag randomization** for fair piece distribution **Controls:** - ← → : Move left/right - ↓ : Soft drop - ↑ : Rotate - Space : Hard drop - P : Pause/Resume The game has a modern dark theme with a gradient background, glowing borders, and polished UI. Just open the file in a browser to play!
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
Functional Tetris with falling pieces, next preview, score/level/lines, and pieces stacking realistically over time and input.
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.