oneshotlm
Compare all models on this prompt →

Mandelbrot explorer · qwen3.8-2.4t-a95b

Output generated Cost / run $0.0342 Runtime 50.1s

Prompt for this run

Render the Mandelbrot set with a smooth color gradient on a full-screen canvas, with click-and-drag to pan and mouse-wheel to zoom.

⛨ 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

modelqwen3.8-2.4t-a95b
vendorQwen
harnesspi-agent
generated2026-08-13

METRICS

runtime50.1s
tokens in6.5k
tokens out3.5k
cached0
cost / run$0.0342
Transcript · 4 messages
user

Render the Mandelbrot set with a smooth color gradient on a full-screen canvas, with click-and-drag to pan and mouse-wheel to zoom.

assistant
thinking
Build a single-file Mandelbrot explorer. Full-screen canvas, smooth coloring (escape-time algorithm using a continuous/smooth iteration count), pan via drag, zoom via mouse wheel centered on the cursor. For performance, consider progressive rendering / low-resolution rendering during interaction. Write index.html.
→ write /tmp/ws/index.html (9268 bytes)
toolResult

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

assistant
thinking
Quickly verify the file's existence (already written). Can I do a simple sanity check with node? Not necessary. Done.

Created `/tmp/ws/index.html` — a fully self-contained Mandelbrot explorer with no external resources. **Features:** - **Full-screen canvas** that adapts to window size and device pixel ratio (capped at 2× for performance) - **Smooth color gradient** using continuous (fractional) escape-time coloring: `n + 1 − log(log|z|)/log2`, mapped through a precomputed 2048-entry color LUT with a classic blue → white → orange → black palette - **Click-and-drag panning** via pointer events (works with mouse and touch), with proper pointer capture - **Mouse-wheel zoom** centered on the cursor position (the point under the cursor stays fixed), with zoom clamping to avoid numerical blowup - **Double-click** resets the view **Performance touches:** - Rendering happens in small slices via `requestAnimationFrame` so the UI never freezes - During drags, a low-res preview is rendered and upscaled; a full-res pass follows when interaction stops - Cardioid and period-2 bulb interior checks skip the expensive iteration loop for the set's interior - Max iterations scale up automatically as you zoom deeper (120 → 2500) - A HUD shows the current center coordinates, zoom level, and iteration budget