A guided, interactive exploration of Conway's FRACTRAN — an esoteric programming language that uses fraction multiplication to perform computation. Built as an explorable explanation in the style of Nicky Case and Exploding Dots.
Guided chapters that let you discover how FRACTRAN works:
- The Game — Learn the rules by playing: multiply by the first fraction that works
- Number Game — Explore single-fraction games and see what they do
- Prime Factors — The key insight: see numbers as products of primes
- Visualization — Watch dots move between prime columns
- Puzzles — Design your own fraction rules
- Computation — The reveal: this "game" is actually programming
Philosophy: No spoilers. You discover patterns before being told what they mean. "Game" terminology is used until you earn the word "program."
Also includes:
- Full sandbox for free-play with any FRACTRAN program
- Preset programs (addition, multiplication, Fibonacci, prime generation)
Prerequisites: Node.js (v18 or higher)
npm install
npm run devOpen http://localhost:3000/fractran-animator/
Automatic deployment via GitHub Actions on push to main. Or manually:
npm run deploy/
App.tsx # Router shell (hash-based routing)
types.ts # TypeScript interfaces
constants.ts # Preset FRACTRAN programs
hooks/
useFractranSim.ts # Simulation state machine (extracted hook)
useHash.ts # Hash routing
services/
fractranLogic.ts # Pure FRACTRAN simulation logic
components/
RegisterBoard.tsx # Bead visualization (prime columns)
ProgramPanel.tsx # Rule list with scanning animation
Controls.tsx # Play/pause/step/speed/scrubber
ChapterLayout.tsx # Chapter page shell
Prose.tsx # Styled typography + Spoiler component
widgets/
NumberGameWidget.tsx # Number-based view (early chapters)
ManualStepWidget.tsx # Interactive "is this a whole number?" widget
MiniSim.tsx # Compact simulator with dot visualization
ProgramBuilder.tsx # User creates their own fraction rules
chapters/ # Chapter content (JSX)
pages/
Landing.tsx # Table of contents
Sandbox.tsx # Full simulator
docs/
ARCHITECTURE.md # Architecture notes for contributors
- React 19 — UI framework
- TypeScript — type safety
- Vite — build tool
- Tailwind CSS — styling (via CDN)
- lucide-react — icons
No routing library, no state management library. Hash-based routing and a custom simulation hook handle everything.
MIT