oneshotlm
Compare all models on this prompt →

2048 · claude-opus-4.8

Output generated Cost / run $0.2182 Runtime 64.5s

Prompt for this run

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 ↗

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-4.8
vendorAnthropic · Claude
harnesspi-agent
generated2026-07-08

METRICS

runtime64.5s
tokens in33k
tokens out5.8k
cached22k
cost / run$0.2182
Transcript · 10 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 going to create a complete 2048 game implementation in a single HTML file.
→ write index.html (11064 bytes)
toolResult

Successfully wrote 11064 bytes to index.html

assistant
thinking
I need to define the CSS custom property for the gap value that I'm using in the layout.

I need to define the `--gap` CSS variable I referenced.

→ edit {"path":"index.html"}
toolResult

Validation failed for tool "edit": - edits: must have required properties edits Received arguments: { "path": "index.html" }

assistant
→ edit {"path":"index.html","edits":[{"oldText":" .board {\n position: relative;\n background: #bbada0;","newText":" .board {\n --gap: 1
toolResult

Successfully replaced 1 block(s) in index.html.

assistant
→ bash {"command":"cd /workspace && node -e \"const fs=require('fs');const s=fs.readFileSync('index.html','utf8');console.log('len',s.length,'gap o
toolResult

len 11081 gap ok true

assistant

Done. `index.html` is a complete, self-contained 2048 game. Features: - **Arrow keys** (or WASD) to slide/merge tiles; **swipe** on touch devices - **Smooth animations**: tiles glide via CSS transforms, new tiles pop in, merges bump - **Score** tracking with a persisted **Best** score (localStorage) - **Win state** at 2048 and **Lose state** when no moves remain, both shown via an overlay with a restart button - Responsive layout with the classic 2048 color scheme Open it directly in any browser to play — no network or external assets needed.