“From simple rules, unexpected highways emerge.” — Observation after Langton (1986)
🚀 Live demo: https://cuteloop.github.io/Vibes/
For each lattice point
The local update rule is a function
where
Mathematicians see it as a playground for emergence, computability (it’s Turing complete!), and probabilistic tilings.
- Pure client‑side HTML + ES‑modules; no bundler.
- Rendering via
p5.json an auto‑scaling canvas (zoom & pan). - Sparse grid stored as a
Set<number>→ linear memory in visited cells. - 60 fps at 10 k steps/frame on a mid‑2020 laptop in Chrome.
- One‑click GitHub Pages deployment (workflow in
.github/workflows/deploy.yml).
python -m http.server 8000 # OR npx serve . -l 8000Open http://localhost:8000 and press Play. Need auto‑reload? → Install the Live Server VS‑Code extension.
Vibes/
├─ index.html # markup
├─ style.css # flex layout + responsive canvas
├─ src/
│ ├─ grid.js # sparse Set, color flips
│ ├─ ant.js # position + heading logic
│ ├─ ui.js # controls wiring (Play/Pause, etc.)
│ └─ main.js # p5 sketch + draw loop
└─ .github/workflows/deploy.yml # auto‑publish to gh‑pages
- Push to
main→ GitHub Action packages the site, creates/updatesgh-pages. - Settings → Pages → Source: “GitHub Actions”. (One‑time toggle.)
- Site is instantly live at
https://CuteLoop.github.io/Vibes/.
This repository was scaffolded in one sitting using Cursor’s agentic code‑generation (“Vibe Coding” mode) powered by OpenAI ChatGPT (o3). Prompts described the desired architecture, performance targets, and deployment pipeline; the assistant produced modular code, tests, and the CI file. Manual edits were limited to tweaking CSS and tightening the math exposition you’re reading now.
Disclaimer. While LLMs accelerate boiler‑plate production, always review logic and security by hand—particularly for projects that do more than colour squares!
- Prove that the ant visits every square infinitely often or eventually enters a highway. (Hint: consider parity arguments and bounding boxes—then realise you’ll need the 2004 result by Gajardo et al.)
- Modify
grid.jsto support$k$ ‑colour ants (Turmites). What new periodicities appear? - Show that Langton’s Ant can simulate a 1‑tape Turing machine. Embed the construction in JavaScript and measure step complexity.
Happy ant‑herding!