Tetris · claude-sonnet-5.5
Output generated Cost / run $0.0490 Runtime 26.0s
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.
/tmp/job-m52GdH/index.html (4823 bytes){"action":"key","text":"ArrowUp"}Successfully wrote to /tmp/job-m52GdH/index.html
Frame 1, +0ms
[Browser image supplied to model]
{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing."],"dom":"TETRIS\nNEXT\n\nSCORE\n0\nLINES\n0\nLEVEL\n1\n←→ move\n↑/X rotate\nZ rotate back\n↓ soft drop\nSpace hard drop\nP pause\nEnter restart","images":"attached"}
I've built the game in `/tmp/job-m52GdH/index.html`. I only checked it by loading the page and pressing Up once, so most of it is untested. The page loaded without errors. After the rotate, the screenshot shows a rotated Z piece, a ghost outline at the bottom, and the next piece in the preview. I haven't played it through, so line clears, speed-up, game over, pause and restart are all unchecked. - **Pieces:** all seven tetrominoes (I, O, T, S, Z, J, L), drawn in a shuffled bag so you get all seven before any repeats. - **Controls:** Left/Right move, Up or X rotates, Z rotates back, Down soft-drops, Space hard-drops, P pauses, Enter restarts. Rotation tries small sideways shifts so pieces can turn next to a wall. - **Display:** a ghost outline shows where the piece will land, and the next-piece preview sits beside the board. - **Scoring:** clearing 1, 2, 3 or 4 lines scores 100, 300, 500 or 800 times your level. Soft drops add 1 point per row and hard drops add 2 points per row. - **Speed:** you move up a level every 10 lines, and each level makes pieces fall about 15% faster, down to a minimum of 80 ms per step.