Implement neighbor-sum-avoidance polish + new computing-pi interactive

neighbor-sum-avoidance (T2-T6):
- Start button now reads just "Start" (no mode suffix).
- Available numbers and shuffled preview arrangements render pre-start
  so the arena isn't empty while the user is still deciding.
- Mode switch + count slider stay mounted once active; they're just
  disabled, so starting no longer causes a layout jump.
- Guided-mode instructions expanded to call out light grey edges, red
  violation arcs, and the green valid-neighbor line explicitly.
- Draggable numbers honor isActive for the draggable attribute and
  onDragStart, showing opacity-60 + cursor-not-allowed when locked.

computing-pi (new interactive under Miscellany):
- N parallel first-passage simulations: toss until heads > tails,
  record the fraction. Average × 4 converges to π.
- Header row: runs slider | live average × 4 | Start/Reset.
- Tile grid uses a mask-gradient marquee so long sequences scroll
  their tail while staying readable.
- Click any tile once all runs complete to see the full toss sequence
  in a Dialog.
- Safety cap of 1000 tosses per run (first-passage time has infinite
  expectation, so without the cap a pathological run could block).
- Registered in interactives.ts + InteractiveRenderer + the parallel
  interactive-components map. Filled in three-bank-accounts in the
  latter while there, since it was missing.

admin-data.json updated to mark T2-T6 done with remarks, remove the
implemented Computing Pi idea, and add an implementation note.
This commit is contained in:
Claude 2026-04-21 11:58:45 +00:00
parent 014d90a36b
commit f527a712be
No known key found for this signature in database
6 changed files with 364 additions and 95 deletions

View file

@ -706,6 +706,24 @@ export const allInteractives: Interactive[] = [
hasGreenScreen: false,
status: "published" as const,
},
{
slug: "computing-pi",
title: "Computing π from Coin Tosses",
description:
"Toss a coin until heads first outnumber tails, record the fraction, and repeat. The average of those fractions approaches π/4 — watch it converge in parallel runs.",
tags: [
"probability",
"simulation",
"pi",
"monte-carlo",
"random-walk",
"convergence",
],
themes: ["Miscellany"],
dateAdded: "2026-04-21",
hasGreenScreen: false,
status: "published" as const,
},
];
/** All published interactives. Use this for public-facing pages. */