oneshotlm
Compare all models on this prompt →

2048 · claude-opus-5

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
I'm building a 2048 game in a single file with smooth animations, using a 4x4 grid of tile objects that track their id, value, row, and column. Each tile will render as a DOM element positioned with CSS transforms, and I'll add animations for new tiles popping in and merged tiles pulsing.
write /tmp/ws/index.html (13153 bytes)
toolResult

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

assistant
thinking
The traversal order processes tiles from the far edge inward, so merged tiles are handled correctly before source tiles get processed. The ghost tile approach works well since the merged tile is removed from the grid and animated separately. The win condition is being tracked with a truthy flag.

The issue is that checking `won` as truthy causes the overlay to re-show on every move after the first win. I need a separate flag to track whether the win overlay has already been displayed, so it only shows once.
edit {"path":"/tmp/ws/index.html","edits":[{"oldText":" if(won){\n won = 'shown';","newText":" if(won && !winShown){\n winShown =
toolResult

Successfully replaced 3 block(s) in /tmp/ws/index.html.

assistant
thinking
The restore function correctly preserves the won state from the snapshot while keeping winShown unchanged, and the dead check still runs properly after winning. The merge logic traverses from the far edge with reversed row/column iteration to move tiles correctly, and since we process tiles from the edge outward, when we double a tile's value it won't be revisited later in the loop.

`index.html` created — a full 2048 game with sliding/merging animations, score + best (localStorage), win/lose overlays, undo (U), keyboard (arrows/WASD/hjkl) and swipe support.

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

modelclaude-opus-5
vendorAnthropic · Claude
harnesspi-agent
generated2026-08-03

EVALUATION

3/5 working

Functional 2048 clone; tiles merge and move correctly with arrow/WASD keys, click/drag/wheel have no effect as expected.

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 keys3.0%
on w/a/s/d2.1%
frame spread24.8 / 255
console errors0
js errors none

METRICS

runtime75.1s
tokens in19k
tokens out6.9k
cached13k
cost / run$0.2207