Reaction-diffusion · ling-2.6-1t
Run a Gray-Scott reaction-diffusion simulation on a canvas that grows organic Turing patterns in real time, with the mouse seeding new growth.
transcript · 4 messages
Run a Gray-Scott reaction-diffusion simulation on a canvas that grows organic Turing patterns in real time, with the mouse seeding new growth.
I'll create a single-page web app that simulates the Gray-Scott reaction-diffusion system, generating organic Turing patterns with mouse interaction for seeding growth.
/tmp/ws/index.html (21341 bytes)Successfully wrote 21341 bytes to /tmp/ws/index.html
I've created a complete Gray-Scott reaction-diffusion simulation as a single HTML file. Here's what it includes: ## Features: **Simulation Core:** - Full Gray-Scott reaction-diffusion equations implemented in JavaScript - Two chemical concentrations (u and v) that react and diffuse across a 2D grid - Laplacian diffusion using 5-point stencil for smooth spreading **Visual Design:** - Rich organic color gradient mapping from deep purple/blue → cyan → teal → green-gold → bright highlights - Subtle glow effects on high-concentration areas - Crosshair cursor with visual feedback showing the seeding radius **Interactivity:** - **Mouse move** - Seeds new growth patterns as you drag across the canvas - **Mouse click** - Strong injection of chemical B to create bursts of activity - **Keyboard shortcuts**: Space = randomize, 1-4 = pattern presets, R = reset - **Touch support** for mobile devices **Pattern Presets:** 1. **Spiral Waves** - Classic rotating spiral patterns 2. **Mazes** - Labyrinthine branching structures 3. **Solitons** - Isolated stable spots 4. **Pulsing** - Rhythmic oscillating patterns **Controls:** - Reset button - Clears and reinitializes the grid - Randomize button - Generates new F/K parameters with random seeds - Pattern buttons - Switch between curated reaction parameters The simulation runs efficiently using Float32Arrays for the concentration grids, with double-buffering for smooth updates. Multiple update steps per frame ensure fast pattern evolution while maintaining performance.
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
EVALUATION
Gray-Scott simulation grows organic Turing patterns, animates on its own, and reacts to click, drag, wheel, and keys with visible seeding.
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.