oneshotlm
Compare all models on this prompt →

Fireworks · qwen3.8-27b

Create a fireworks display on a full-screen canvas where clicks launch shells that explode into gravity-affected, fading particle bursts.

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

Create a fireworks display on a full-screen canvas where clicks launch shells that explode into gravity-affected, fading particle bursts.

assistant
thinking
Build index.html containing a fireworks canvas.
write index.html (6354 bytes)
toolResult

Successfully wrote 6354 bytes to index.html

assistant
thinking
Confirm that the file exists.
bash {"command":"ls -la /tmp/ws/index.html"}
toolResult

-rw-r--r--. 1 node node 6354 Aug 15 13:51 /tmp/ws/index.html

assistant
thinking
Wait — about the rocket launch logic: the rocket starts from startY = H + 10, and vy0 is calculated to reach the target. If t = 38–60 frames and dy is large, then vy0 = (2*dy + 0.5*G*t²)/t. For dy=800, t=50: (1600 + 0.5*0.06*2500)/50 = (1600+75)/50 ≈ 33.5. That's extremely fast, but it's fine — the rocket travels upward. Actually, wait: the rocket moves upward, so y decreases. startY - targetY = dy > 0. Position: y(t) = startY - vy0*t + 0.5*G*t². Setting y(t)=targetY: startY - targetY = vy0*t - 0.5*G*t² → dy = vy0*t - 0.5*G*t² → vy0 = (dy + 0.5*G*t²)/t. I wrote (2*dy + 0.5*G*t²)/t — that's wrong. Hmm, let me check: y(t) = startY + vy0*t + 0.5*a*t², where a = +GRAVITY (vy increases downward… vy is positive downward). vy0 is negative (upward). y(t) = startY + vy0*t + 0.5*G*t². Setting = targetY: startY - targetY = -vy0*t - 0.5*G*t² → dy = -(vy0*t + 0.5*G*t²) → vy0 = -(dy - 0.5*G*t²)/t = (0.5*G*t² - dy)/t.

So vy0 = (0.5*G*t² - dy)/t. In my formula, vy0 = (2*dy + 0.5*G*t²)/t is positive, which means downward — the rocket immediately accelerates downward, and vy > -0.5 is immediately true → it explodes on the first frame at the bottom of the screen. Bad. Fix the formula.

Fix: const vy0 = (0.5 * GRAVITY * t * t - dy) / t;

Let me fix a physics error in the rocket launch calculation:

edit {"path":"index.html","edits":[{"oldText":" const dy = startY - targetY;\n // choose flight time\n const t = rand(38, 60);\n cons
toolResult

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

assistant
thinking
Check whether the rocket explodes correctly: vy0 = (0.5*0.06*t² - dy)/t. For t=50, dy=800: (75-800)/50 = -14.5. Good, upward. It explodes when vy > -0.5, i.e., when it nears the apex. Time to apex: 14.5/0.06 ≈ 242 frames, much longer than t=50. In other words, it doesn't reach the apex within the flight time — meaning it explodes at a point where vy is still... At t=50, vy = -14.5 + 0.06*50 = -11.5. It won't explode by the apex condition! The rocket keeps going past the target and flies off the top of the screen (y < 0). At the top it's removed and explodes, but that's above the screen. Hmm.

Better approach: track the flight, and explode when the rocket has passed through the target point, or after t frames. Simplest method: give the rocket a "fuse" = t, and explode after fuse frames have elapsed. Let's add that.
edit {"edits":[{"newText":" vy: vy0,\n fuse: t,\n hue: HUES[Math.floor(Math.random() * HUES.length)],","oldText":" vy: vy0,\n
toolResult

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

assistant
thinking
Wait — but now, due to my correction of the equation, the rocket will reach targetY exactly at t frames (ignoring random vx). Good, it explodes at the target.

One point: vy0 = (0.5*G*t² - dy)/t — verifying: y(t) = startY + vy0*t + 0.5*G*t² = startY + (0.5*G*t² - dy) + 0.5*G*t² = startY + G*t² - dy. Hmm, this becomes targetY + G*t², which is G*t² too low (below the target). Let me redo this:

y(t) = startY + vy0*t + 0.5*G*t² = targetY
vy0*t = targetY - startY - 0.5*G*t² = -dy - 0.5*G*t²
vy0 = (-dy - 0.5*G*t²)/t = -(dy + 0.5*G*t²)/t

So vy0 = -(dy + 0.5*GRAVITY*t*t)/t. I was missing the sign. Fixing it.
edit {"edits":[{"newText":" // Choose flight time t; solve y(t) = startY + vy0*t + 0.5*G*t^2 = targetY\n const t = rand(38, 60);\n const
toolResult

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

assistant
thinking
Alright, the rocket's vy0 is negative (upward), and it reaches targetY exactly at t frames, so it explodes at the click position.

Quick syntax check using node? The script is browser JS, but I can verify the syntax by extracting it. Easier approach: use node --check on the extracted script. Let me try a simple check.
bash {"command":"cd /tmp/ws && awk '/<script>/{f=1;next}/<\\/script>/{f=0}f' index.html > /tmp/fw.js && node --check /tmp/fw.js && echo OK"}
toolResult

OK

assistant
thinking
Complete. The file exists, syntax has been verified.

Done. `index.html` is created in `/tmp/ws` — a fully self-contained, no-network single-page fireworks app: **Features** - **Full-screen canvas** that resizes with the window - **Click to launch**: a shell rises from the bottom with a glowing trail, follows a real ballistic arc (flight time/velocity solved so it bursts right at your click point), and explodes on a fuse timer - **Particle bursts** with three random shapes: classic sphere, ring, and slow-drooping willow - **Gravity + air drag** on every spark, with colors shifting to dim embers as they fade - **White flash** at the explosion center - **Additive blending** (`lighter`) with a semi-transparent black fade pass for smooth motion trails - 30–35% chance of a bonus shell per click, and 3 auto-launches on load so the screen isn't empty - Fades a "click anywhere" hint after first interaction Syntax verified with `node --check`. Open `index.html` in any browser to use it.

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.8-27b
vendorQwen
harnesspi-agent
generated2026-08-15

EVALUATION

4/5 working

Fireworks auto-launch and clicking spawns colorful particle bursts that fade; keyboard/wheel had 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 motion1.3%
on click1.8%
on drag1.3%
on wheel0.0%
on enter + space0.0%
on arrow keys0.0%
on w/a/s/d0.0%
frame spread9.9 / 255
console errors0
js errors none

METRICS

runtime383.3s
tokens in32k
tokens out4.4k
cached0
cost / run$0.0285