oneshotlm
Compare all models on this prompt →

Tetris · glm-4.6

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 ↗
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 create a complete Tetris game in a single HTML file. Let me think about what I need to implement:

1. Canvas rendering for the game board
2. All seven tetrominoes (I, O, T, S, Z, J, L)
3. Rotation mechanics
4. Line clearing
5. Increasing speed as the game progresses
6. Next piece preview
7. Score system
8. Controls (arrow keys for movement, up for rotation, space for drop)

Let me structure this as a complete HTML file with inline CSS and JavaScript.

Key components:
- Game board (typically 10x20 grid)
- Tetromino shapes and colors
- Game loop with drop timing
- Collision detection
- Line clearing logic
- Score calculation
- Speed progression
- UI elements for score, level, next piece

I'll make sure to include:
- Start/pause functionality
- Game over detection
- Smooth animations
- Proper rotation handling
- Wall kick logic for better rotation nearedges
write /tmp/ws/index.html (19934 bytes)
toolResult

Successfully wrote 19934 bytes to /tmp/ws/index.html

assistant
thinking
Perfect! I've created a complete Tetris game in a single HTML file with all the requested features:

1. ✅ All seven tetrominoes (I, O, T, S, Z, J, L) with their classic colors
2. ✅ Rotation mechanics with wall kick support
3. ✅ Line clearing with scoring (40, 100, 300, 1200 points based on lines cleared)
4. ✅ Increasing speed as levels progress (every 10 lines)
5. ✅ Next piece preview window
6. ✅ Score, level, and lines cleared display
7. ✅ Ghost piece showing where the piece will land
8. ✅ Smooth controls (arrow keys, space for hard drop, P for pause)
9. ✅ Game over detection and restart functionality
10. ✅ Pause functionality
11. ✅ Visual effects like gradients on blocks and grid lines

The game is fully self-contained with no external dependencies and should run perfectly in any modern browser. The UI has a nice gradient background and the game board has a classic Tetris feel with proper visual feedback.

Created a fully playable Tetris game in `index.html` with all requested features: **Features implemented:** - All 7 tetrominoes (I, O, T, S, Z, J, L) with classic colors - Smooth rotation with wall kick mechanics - Line clearing with proper scoring (1-4 lines) - Progressive difficulty (speed increases every 10 lines) - Next piece preview window - Score, level, and lines counter - Ghost piece showing landing position - Hard drop (space) and soft drop (down arrow) - Pause functionality (P key) - Game over detection with restart option - Visual effects with gradients and grid lines **Controls:** - ← → : Move left/right - ↑ : Rotate - ↓ : Soft drop (1 point per row) - Space : Hard drop (2 points per row) - P : Pause/Resume The game runs entirely offline in a single self-contained HTML file with no external dependencies.

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-4.6
vendorZ.ai · GLM
harnesspi-agent
generated2026-08-01

EVALUATION

4/5 working

Functional Tetris with pieces falling, rotation, score, next-piece preview, and controls responding to keyboard input.

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.

idle motion0.9%
on click1.0%
on drag1.0%
on wheel1.0%
on enter + space2.0%
on arrow keys1.2%
on w/a/s/d1.6%
frame spread45.4 / 255
console errors0
js errors none

METRICS

runtime163.8s
tokens in7.5k
tokens out5.0k
cached1.5k
cost / run$0.0131