Tetris · deepseek-v4-pro
Build a playable Tetris on a canvas with all seven tetrominoes, rotation, line clears, increasing speed, a next-piece preview, and score.
transcript · 6 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 fully playable Tetris game in a single index.html file with all the classic features: 1. All seven tetrominoes (I, O, T, S, Z, J, L) 2. Rotation 3. Line clears 4. Increasing speed 5. Next-piece preview 6. Score display 7. Canvas-based rendering 8. No external resources Let me build this step by step. I'll create the complete game with: - A 10x20 board - All 7 tetrominoes with their shapes and colors - Keyboard controls (arrow keys for movement, up for rotation, space for hard drop) - Line clearing with animation - Score system (standard Tetris scoring) - Level system with increasing speed - Next piece preview - Game over detection - Proper collision detection Let me write this comprehensive game.
/workspace/index.html (16217 bytes)Successfully wrote 16217 bytes to /workspace/index.html
thinking
Done. Let me verify the file was created properly.
The file is written. Let me verify it's in place
{"command":"ls -lh /workspace/index.html && wc -l /workspace/index.html"}-rw-r--r-- 1 node node 17K Jul 10 00:31 /workspace/index.html 644 /workspace/index.html
thinking
The file is created. Let me give a summary of what was built.
Done — `/workspace/index.html` (17 KB, 644 lines). Here's what's included: **Core gameplay** - All 7 tetrominoes (I, J, L, O, S, T, Z) with proper 4-rotation states - 10×20 board rendered on a `<canvas>` - Collision detection with wall kicks on rotation (horizontal ±1/±2 and vertical -1/-2 offsets) - Ghost piece showing where the current piece will land **Controls** | Key | Action | |---|---| | ← → | Move left/right | | ↑ | Rotate | | ↓ | Soft drop (+1 pt per row) | | Space | Hard drop (+2 pts per row) | | P | Pause/resume | | R / Space | Restart after game over | **Features** - **Next-piece preview** in a side panel - **Score**: 100/300/500/800 points for 1/2/3/4 line clears, multiplied by level - **Level system**: level increases every 10 lines cleared - **Speed**: starts at 800ms, decreases by 45ms per level, floors at 80ms - **3D beveled blocks** with highlights and shadows - **Pause overlay** with dimmed board - **Touch controls**: tap to rotate, swipe down to hard drop, swipe left/right to move - Zero external dependencies — fully self-contained
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, score/level/lines, next preview, and responsive keyboard controls; mouse inputs also affect state oddly.
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.