oneshotlm
Compare all models on this prompt →

2048 · qwen3.6-flash

Build a playable 2048 game with arrow-key tile sliding and merging, smooth animations, a score, and win and lose states.

⛨ sandboxed Open in new tab ↗
transcript · 6 messages
user

Build a playable 2048 game with arrow-key tile sliding and merging, smooth animations, a score, and win and lose states.

assistant
thinking
The user wants a complete, playable 2048 game in a single HTML file. Let me build this with:

1. HTML structure: game board, score display, win/lose overlays
2. CSS: styling for tiles, animations, responsive grid
3. JS: game logic (sliding, merging, spawning), keyboard input, win/lose detection, smooth slide/merge animations

Key features:
- Arrow key controls
- Smooth CSS transitions for tile movement and merging
- Score tracking
- Win state (reaching 2048)
- Lose state (no more moves possible)
- Nice color scheme matching the classic 2048 aesthetic

Let me write this out completely.
write /workspace/index.html (19843 bytes)
toolResult

Successfully wrote 19843 bytes to /workspace/index.html

assistant
thinking
I notice there's a bug in my code - there's a `move()` function that starts executing but never gets cleanly replaced. The `cleanMove()` function is the correct one, but the code flow is broken because `move()` doesn't exist in my final version and there's extra code. Let me rewrite the file cleanly.

Let me clean up the code — there's residual logic from an early draft that would cause issues.

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

Successfully wrote 14961 bytes to /workspace/index.html

assistant
thinking
The file has been written. Let me verify it's correct and complete.

The game includes:
- 4x4 grid with background cells
- Arrow key controls (Up, Down, Left, Right)
- Touch/swipe support for mobile
- Smooth CSS transitions for tile sliding (0.12s ease)
- Pop-in animation for new tiles
- Merge pop animation when tiles combine
- Score tracking with localStorage for best score
- Win state at 2048 with "Continue" option
- Lose state when no moves remain with "Try Again"
- Proper tile colors matching the classic 2048 game
- New Game button to restart
- Responsive sizing with aspect-ratio and clamp()

Let me verify the file was written correctly.

The file is written. Here's what's included in the self-contained `index.html`: **Gameplay:** - Standard 4×4 2048 sliding & merging logic with arrow keys (`↑ ↓ ← →`) - Touch/swipe support for mobile play - A "New Game" button to restart anytime **Animations:** - `0.12s ease` CSS transitions for smooth tile sliding - **Pop-in** animation when new tiles spawn - **Merge-bounce** animation when tiles combine **States:** - **Score / Best** tracking (best persists in localStorage) - **Win overlay** at 2048 with a "Continue" button to keep playing - **Game Over overlay** when no moves remain, with "Try Again" to restart **Visuals:** - Classic 2048 color palette for each tile value (2, 4, 8, … 2048, and super tiles) - Glowing box-shadows on high tiles (128+) - Responsive sizing using `clamp()` and `aspect-ratio` No external resources, CDNs, or network requests — fully sandboxed.

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

modelqwen3.6-flash
vendorQwen
harnesspi-agent
generated2026-07-10

EVALUATION

3/5 working

2048 game responds to arrow keys with tile movement and score updates; WASD/click/drag/wheel show no additional response.

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.0%
on click0.0%
on drag0.0%
on wheel0.0%
on enter + space0.0%
on arrow keys0.4%
on w/a/s/d0.0%
frame spread24 / 255
console errors0
js errors none

METRICS

runtime72.8s
tokens in24k
tokens out13k
cached0
cost / run$0.0189