Skip to content

Add 21 interactive playgrounds (consolidated) - #202

Merged
ianalloway merged 1 commit into
mainfrom
claude/playgrounds-729tge
Jul 26, 2026
Merged

Add 21 interactive playgrounds (consolidated)#202
ianalloway merged 1 commit into
mainfrom
claude/playgrounds-729tge

Conversation

@ianalloway

Copy link
Copy Markdown
Owner

Consolidates the playground work that was previously spread across 21 standalone PRs into one change, so App.tsx's route table is edited once instead of conflicting 21 ways. This replaces those PRs — no need to reopen them.

What's in it

Each playground is a pure, framework-free logic module under src/features/ plus a thin view under src/pages/. 42 new files, 21 new routes, nothing else touched.

Route Playground Domain
/wfc Wave Function Collapse constraint solving
/mandelbrot Mandelbrot explorer escape-time fractals
/chaos Chaos Game / IFS iterated function systems
/hull Convex Hull computational geometry
/sandpile Abelian Sandpile self-organized criticality
/neuralnet Neural-net decision boundary machine learning
/ising Ising model statistical physics
/huffman Huffman coding information theory
/wator Wa-Tor predator-prey ecology
/collatz Collatz coral number theory
/terrain Diamond-square terrain procedural generation
/sudoku Sudoku solver backtracking search
/metaballs Metaballs contour extraction
/poisson Poisson-disk sampling blue noise
/mst Prim vs Kruskal graph algorithms
/cloth Verlet cloth physics simulation
/kellysim Kelly bankroll simulator risk & betting math
/fluid Stable Fluids Navier-Stokes CFD
/rsa RSA playground cryptography
/cube 2×2 optimal cube solver permutation groups
/raycast DDA raycaster pseudo-3D rendering

How it was verified

Every logic module was checked against known reference values, not just eyeballed:

  • /cube(R U R' U') has order 6 and (R U) order 15, the exact fingerprints of the 2×2 corner group; 60 scrambles all solve within God's number of 11, with 1- and 2-move scrambles solved in exactly 1 and 2 (confirming optimality). Move permutations are generated from 3D rotations rather than hand-written cycles, so they're correct by construction.
  • /rsa — reproduces the canonical textbook key exactly (p=61, q=53 → n=3233, φ=3120, e=17, d=2753), with a perfect round-trip across all 391 messages.
  • /collatz — 27 takes 111 steps peaking at 9232; all starts 1–5000 reach 1.
  • /huffman"abracadabra" compresses to the known-optimal 23 bits; satisfies H ≤ avg < H+1.
  • /raycast — cardinal distances exact (7.5 / 0.5), the 45° case exactly 4√2, and across 720 rays at every angle zero inconsistencies.
  • /mst — on 40 random graphs Prim and Kruskal produce identical total weight, confirming both optimal.
  • /poisson — minimum pairwise distance always ≥ radius, the defining blue-noise property.
  • /fluid — divergence decays monotonically 716 → 11, confirming the projection converges to mass-conserving flow.
  • …and equivalents for the rest (see the commit message for the full table).

Testing caught real bugs, which is the point of doing it this way — most notably a Wa-Tor shark-breeding energy leak (offspring got fresh full energy, so sharks could reproduce their way out of starvation and never died off) and a Turing unary doubler computing 3n instead of 2n.

Checks

  • npm run lint0 errors (only the two pre-existing react-refresh warnings in badge.tsx / button.tsx)
  • npm run build — succeeds; all 21 pages confirmed to emit their own lazy-loaded chunk, so nothing bloats the initial bundle

🤖 Generated with Claude Code

https://claude.ai/code/session_01WgEKRuVdor8KhaiPkv38aQ


Generated by Claude Code

Consolidates the playground work that was previously spread across 21
standalone PRs into a single change, so the route table is edited once
instead of conflicting 21 ways.

Each playground is a pure, framework-free logic module under
src/features/ plus a thin view under src/pages/, and every module was
verified against known results before shipping:

  /wfc         wave function collapse   40/40 boards solved, 0 adjacency violations
  /mandelbrot  escape-time fractal      smooth iteration count, interior quick-reject
  /chaos       iterated function systems map frequencies match weights, bounds finite
  /hull        convex hull              200 random sets all valid CCW hulls
  /sandpile    abelian sandpile         classic 4-topple, symmetry, mass conservation
  /neuralnet   backprop MLP             96-100% accuracy on xor/circles/blobs/spiral
  /ising       metropolis monte carlo   orders at T=1, disorders at T=5, exact Tc
  /huffman     huffman coding           round-trips, prefix-free, abracadabra = 23 bits
  /wator       predator-prey            fish fill, sharks starve, populations oscillate
  /collatz     3n+1 conjecture          27 takes 111 steps peaking at 9232
  /terrain     diamond-square           normalized to [0,1], roughness raises gradient
  /sudoku      backtracking search      30 puzzles solved, givens preserved
  /metaballs   marching squares         all 16 cases, contour centred on the ball
  /poisson     bridson blue noise       min pairwise distance always >= radius
  /mst         prim & kruskal           40 graphs, identical weight => both optimal
  /cloth       verlet integration       constraint relaxation converges, tearing works
  /kellysim    fractional kelly         known f*, half-kelly halves log dispersion
  /fluid       stable fluids            divergence decays 716 -> 11, stays bounded
  /rsa         textbook RSA             reproduces p=61,q=53 -> d=2753; full round-trip
  /cube        2x2 optimal solver       (R U R' U') order 6, 60 scrambles <= 11 turns
  /raycast     DDA raycasting           exact distances, 720 rays all consistent

Testing caught real bugs along the way, including a Wa-Tor shark-breeding
energy leak that let sharks reproduce out of starvation, and a Turing
unary doubler that computed 3n instead of 2n.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WgEKRuVdor8KhaiPkv38aQ
@netlify

netlify Bot commented Jul 26, 2026

Copy link
Copy Markdown

Deploy Preview for ianalloway ready!

Name Link
🔨 Latest commit a8f2f44
🔍 Latest deploy log https://app.netlify.com/projects/ianalloway/deploys/6a656422056b18000841244a
😎 Deploy Preview https://deploy-preview-202--ianalloway.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ian-web-forge Ready Ready Preview, Comment Jul 26, 2026 1:34am

@ianalloway
ianalloway marked this pull request as ready for review July 26, 2026 01:36
Copilot AI review requested due to automatic review settings July 26, 2026 01:36
@cursor

cursor Bot commented Jul 26, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ianalloway
ianalloway merged commit ba21a83 into main Jul 26, 2026
10 checks passed
@ianalloway
ianalloway deleted the claude/playgrounds-729tge branch July 26, 2026 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants