oneshotlm
Compare all models on this prompt →

Tetris · glm-5

Output generated Cost / run $0.0135 Runtime 71.5s

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.

⛨ sandboxed Open in new tab ↗

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

modelglm-5
vendorZ.ai · GLM
harnesspi-agent
generated2026-07-22

METRICS

runtime71.5s
tokens in8.0k
tokens out5.3k
cached2.8k
cost / run$0.0135
Transcript · 4 messages
user

Build a playable Tetris on a canvas with all seven tetrominoes, rotation, line clears, increasing speed, a next-piece preview, and score.

assistant
thinking
The user wants me to build a playable Tetris game with the following 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

I need to create a single HTML file with everything inline (CSS in <style>, JS in <script>). Let me build a complete Tetris game.
→ write /workspace/index.html (21467 bytes)
toolResult

Successfully wrote 21467 bytes to /workspace/index.html

assistant
thinking
I've created a complete Tetris game with all the requested features. Let me verify the file was created correctly.

I've created a fully playable Tetris game in `/workspace/index.html`. Here's what's included: ## Features Implemented: 1. **All 7 Tetrominoes** - I, O, T, S, Z, J, L pieces with distinct colors 2. **Rotation** - Arrow Up to rotate, with wall-kick logic to handle edge cases 3. **Line Clears** - Complete rows are detected and cleared 4. **Increasing Speed** - Speed increases with each level (level up every 10 lines) 5. **Next-Piece Preview** - Shows the upcoming piece in the side panel 6. **Score System** - Points for soft drops (1pt), hard drops (2pt/cell), and line clears (100/300/500/800 for 1-4 lines, multiplied by level) ## Controls: - **←/→** - Move left/right - **↑** - Rotate - **↓** - Soft drop (faster descent) - **Space** - Hard drop (instant drop) - **P** - Pause/unpause ## Additional Features: - Ghost piece preview showing where the piece will land - Level display (increases every 10 lines) - Lines cleared counter - Game over screen with final score - Modern neon-style UI with 3D block effects - Grid lines for better visibility Open the file in a browser and click "Start Game" to play!