An interactive web-based cellular automaton simulator with a near-infinite grid, pattern placement, and a visual rules editor.
- Infinite grid with pan and zoom
- Paint/Pan modes for drawing cells or navigating the grid
- Pattern library with common shapes (gliders, oscillators, methuselahs)
- Visual rules editor with clickable 3x3 grids to toggle birth/survival conditions
- 12 presets including Conway's Life, HighLife, Seeds, and more
- Simulation controls (play/pause, step, speed adjustment)
This is a single-file application with no dependencies. Just open index.html in a web browser:
open index.htmlOr serve it with any static file server:
# Python
python3 -m http.server 8000
# Node.js
npx serveThen visit http://localhost:8000
- Go to the repository settings on GitHub
- Navigate to Pages in the sidebar
- Under Source, select Deploy from a branch
- Choose the
mainbranch and/ (root)folder - Click Save
The site will be available at https://<username>.github.io/cellular-automata
If you need to regenerate the favicon PNGs (e.g., after changing the design), use the included scripts:
# Using ImageMagick (recommended)
./generate-favicons.sh
# Or open generate-favicons.html in a browser and click the buttonsNote: These scripts are not currently part of the automated deployment process. The generated favicon files are committed to the repository. If you want to automate favicon regeneration in CI/CD, you could add the script execution to .github/workflows/static.yml before the build step.
Since this is a static HTML file, it can be deployed to any static hosting service:
- Netlify
- Vercel
- Cloudflare Pages
- Any web server that serves static files
- Left-click/drag: Paint cells (in Paint mode) or pan (in Pan mode)
- Scroll wheel: Zoom in/out
- Tab: Toggle between Paint and Pan modes
- Space: Play/Pause simulation
- N: Step forward one generation
- C: Clear the grid
- R: Randomize the grid
- ESC: Cancel pattern placement or close modals
The project includes end-to-end tests using Playwright to verify core functionality.
First, install dependencies:
npm install
npx playwright install chromiumThen run the test suite:
npm testThis will run all 7 E2E tests covering:
- Page loads and canvas renders
- Cell painting (click to add/remove cells)
- Play/pause simulation advances generations
- Pattern placement from dropdown
- Rules modal opens, changes rules, applies
- Zoom and pan interactions
- Clear button resets the grid
For interactive test development, use the Playwright UI mode:
npm run test:uiTests run automatically in CI on every push to main via GitHub Actions.
MIT