oneshotlm
Compare all models on this prompt →

Tetris · kimi-k2.7-code

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 a playable Tetris game in a single index.html file with:
- Canvas-based
- All seven tetrominoes
- Rotation
- Line clears
- Increasing speed
- Next-piece preview
- Score

I'll create a self-contained HTML file with inline CSS and JS. I need to make sure it uses no external resources.

Let me plan the code:
1. HTML structure with canvas for game and preview
2. CSS for layout
3. JavaScript game logic:
   - Tetromino definitions (I, O, T, S, Z, J, L)
   - Game board (10x20)
   - Piece movement/rotation
   - Collision detection
   - Line clearing
   - Scoring
   - Speed increase
   - Next piece preview
   - Game loop
   - Controls

I'll write the complete file directly.

write /workspace/index.html (15212 bytes)
toolResult

Successfully wrote 15212 bytes to /workspace/index.html

assistant
thinking
  Let me verify the file exists and is correct.

bash {"command":"ls -l /workspace/index.html && head -20 /workspace/index.html && echo '---' && tail -10 /workspace/index.html"}
toolResult

-rw-r--r-- 1 node node 15220 Jul 10 00:31 /workspace/index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Tetris</title> <style> :root { --bg: #111; --panel: #1a1a1a; --text: #eee; --accent: #0ff; } * { margin: 0; padding: 0; box-sizing: border-box; } --- updateUI(); }); restartBtn.addEventListener('click', resetGame); resetGame(); </script> </body> </html>

assistant
thinking
  The file is written. It contains:
- Canvas-based board with 10x20 grid
- All 7 tetrominoes (I, O, T, S, Z, J, L)
- Rotation with wall kicks
- Line clears with scoring
- Increasing speed as level advances
- Next piece preview
- Score, lines, level display
- Ghost piece
- Hard drop / soft drop
- Pause
- Game over / restart

Everything is inline with no external resources.

Done! Built a fully self-contained playable Tetris at `/workspace/index.html`. Features included: - Canvas-based 10×20 Tetris board - All 7 tetrominoes (I, O, T, S, Z, J, L) with distinct colors - Rotation with basic wall kicks - Line clearing with scoring - Increasing speed every level (level up every 10 lines) - Next-piece preview panel - Ghost piece showing hard-drop landing - Score, lines, and level displays - Soft drop, hard drop, and pause controls - Game over screen with restart Controls: - ← / → : Move - ↑ : Rotate - ↓ : Soft drop - Space : Hard drop - P : Pause Open `index.html` in any modern browser to play — no network required.

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

modelkimi-k2.7-code
vendorMoonshot · Kimi
harnesspi-agent
generated2026-07-10

EVALUATION

4/5 working

Functional Tetris with falling pieces, next preview, score/lines/level, and pieces respond to keyboard controls including hard drop and rotation.

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 drag1.4%
on wheel1.9%
on enter + space1.8%
on arrow keys0.9%
on w/a/s/d0.7%
frame spread14.9 / 255
console errors0
js errors none

METRICS

runtime132.0s
tokens in5.9k
tokens out5.8k
cached9.0k
cost / run$0.0261