Tetris · glm-5.3
Output generated Cost / run $0.0229 Runtime 40.2s
Prompt for this run
Build a playable Tetris on a canvas with all seven tetrominoes, rotation, line clears, increasing speed, a next-piece preview, and score.
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
METRICS
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.
index.html (9388 bytes)Successfully wrote 9388 bytes to index.html
thinking
Clean up unused cells() function? It has a bug but it's unused — leave or remove. Remove to be safe.
{"edits":[{"newText":"function pieceCells(p,rot){return SHAPES[p.type][(rot+4)%4].map(c=>[c[0]+p.x,c[1]+p.y]);}","oldText":"function cells(pSuccessfully replaced 1 block(s) in index.html.
Done — `index.html` contains a fully playable Tetris: - **All 7 tetrominoes** (I, J, L, O, S, T, Z) with distinct colors and 4 rotation states - **Controls**: ← → move (with key repeat), ↑ rotate (with wall kicks), ↓ soft drop (+1 pt/cell), Space hard drop (+2/cell), P pause, R restart - **Line clears** with scoring (100/300/500/800 × level), **level up every 10 lines**, drop speed increases per level (800ms down to 80ms min) - **Next-piece preview** panel plus score/level/lines HUD, ghost piece showing landing position, and a game-over/start overlay — all self-contained with no external resources.