oneshotlm
Compare all models on this prompt →

Tetris · glm-4.5

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 · 6 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 complete Tetris game in a single HTML file with:
1. Canvas-based rendering
2. All seven tetrominoes (I, O, T, S, Z, J, L)
3. Rotation mechanics
4. Line clearing
5. Increasing speed as game progresses
6. Next piece preview
7. Score tracking
8. No external resources - completely self-contained

Let me create a comprehensive Tetris game with all these features.

I'll create a complete, playable Tetris game with all the features you requested. Let me build this in a single self-contained HTML file.

write /tmp/ws/index.html (20271 bytes)
toolResult

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

assistant
thinking
I've created a complete, self-contained Tetris game in a single HTML file. Let me verify the file was created correctly.
bash {"command":"ls -la /tmp/ws/index.html"}
toolResult

-rw-r--r--. 1 node node 20279 Aug 1 20:57 /tmp/ws/index.html

assistant
thinking
I've created a fully playable Tetris game with all the requested features. Let me summarize what's included:

1. **Canvas-based rendering** - Uses HTML5 canvas for smooth graphics
2. **All seven tetrominoes** - I, O, T, S, Z, J, L pieces with distinct colors
3. **Rotation** - With wall kick support to handle edge cases
4. **Line clears** - Detects and clears complete rows
5. **Increasing speed** - Speed increases with each level (every 10 lines)
6. **Next-piece preview** - Shows the upcoming piece in a side panel
7. **Score tracking** - Points for soft drops, hard drops, and line clears (with multipliers for multiple lines)

Additional features:
- Ghost piece showing where the current piece will land
- Level system
- Lines counter
- Pause functionality (P key)
- Game over detection with restart option
- Keyboard controls (arrows + space)
- Beautiful 3D-style block rendering
- Responsive, modern UI with gradient background
- No external dependencies - completely self-contained

The game is ready to play!

I've created a complete, playable Tetris game in `/tmp/ws/index.html` with all the features you requested: **Features included:** - ✅ **Canvas-based rendering** with smooth 60fps gameplay - ✅ **All 7 tetrominoes** (I, O, T, S, Z, J, L) with unique colors - ✅ **Rotation** with wall-kick support for edge cases - ✅ **Line clears** with visual feedback - ✅ **Increasing speed** - drops faster every 10 lines (new level) - ✅ **Next-piece preview** panel showing upcoming piece - ✅ **Score tracking** - points for drops and line clears (100/300/500/800 for 1/2/3/4 lines) **Bonus features:** - Ghost piece showing where the current piece will land - Level system and lines counter - Pause functionality (P key) - Hard drop with Space bar - 3D-style block rendering with highlights/shadows - Modern dark theme with gradient background - Game over screen with final score and restart button - No external dependencies - completely self-contained **Controls:** - ← → : Move left/right - ↓ : Soft drop (+1 point per cell) - ↑ : Rotate - Space : Hard drop (+2 points per cell) - P : Pause/Resume Open the file 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

modelglm-4.5
vendorZ.ai · GLM
harnesspi-agent
generated2026-08-01

EVALUATION

4/5 working

Functional Tetris with pieces falling, rotation, score/level/lines tracking, and next-piece preview 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.7%
on click0.9%
on drag0.9%
on wheel1.0%
on enter + space1.7%
on arrow keys1.7%
on w/a/s/d0.9%
frame spread18.3 / 255
console errors0
js errors none

METRICS

runtime111.8s
tokens in14k
tokens out5.3k
cached8.6k
cost / run$0.0157