Tetris · qwen3.8-max
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
Write a complete Tetris game in index.html. Include: 7 types of tetrominoes, rotation (with basic wall kicks), line clearing, speed increase based on level, next piece preview, score, keyboard controls, game over, pause.
/tmp/ws/index.html (12005 bytes)Successfully wrote 12005 bytes to /tmp/ws/index.html
thinking
Quick sanity check — maybe I should quickly verify the rotation math with a small JS test in node. Rotation on a square box of size n: clockwise is [n-1-y, x]. For the I-piece, the box is 4x4 (max coord 3 → n=4). Good. T/S/Z/J/L have max coord 2 → 3x3 box. O is skipped. Let me quickly verify in node.
{"command":"node -e \"\nconst SHAPES = {\n I: [[0,1],[1,1],[2,1],[3,1]], T: [[1,0],[0,1],[1,1],[2,1]],\n};\nfunction rotateCells(cells, dir[[1,0],[0,1],[1,1],[2,1]] [[2,1],[1,0],[1,1],[1,2]] [[1,2],[2,1],[1,1],[0,1]] [[0,1],[1,2],[1,1],[1,0]]
thinking
The rotation cycles correctly through the four orientations. Done.
Done — `index.html` is a fully self-contained Tetris game (no external resources). Features: - **All 7 tetrominoes** (I, O, T, S, Z, J, L) with classic colors, using a **7-bag randomizer** so piece distribution stays fair - **Rotation** — CW (↑/X) and CCW (Z), with wall kicks and a floor-shift kick so rotations near walls/floor still work - **Line clears** with standard scoring: 100/300/500/800 × level for 1–4 lines, plus soft-drop (+1/cell) and hard-drop (+2/cell) bonuses - **Increasing speed** — level up every 10 lines; gravity drops from 1000ms down to a floor of 80ms - **Next-piece preview** on a separate canvas - **Score, lines, and level** HUD panels - Extras: ghost piece showing landing position, pause (P), start/restart via Enter or button, game-over overlay Controls: ←/→ move, ↓ soft drop, ↑/X rotate CW, Z rotate CCW, Space hard drop, P pause, Enter start. Verified the rotation math produces correct 4-way cycles. Just open `/tmp/ws/index.html` 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 clone with pieces falling, scoring, and keyboard controls working correctly.
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.