---
HexLife Explorer sits at the crossroads of **artificial life**, **complex systems**, and
**generative art**. Its two-state worlds wrap at both edges, so the simulation surface is a torus
rather than a box. The app gives you both a fast sandbox for direct experimentation and a set of
tools for preserving, comparing, measuring, and sharing what you find.
The simulation core is written in **Rust → WebAssembly**. Each of the nine worlds runs in its own
**Web Worker**, while **WebGL2 instancing** keeps rendering responsive as rules, seeds, and grid
sizes change.
## ✨ Highlights
- **Nine worlds at once** — a 3×3 grid with one world enlarged, so you can compare rules, seeds, and
mutations side by side in real time.
- **Rulesets as first-class objects** — edit all 128 transitions through three lenses, mutate, breed,
undo, and name them; every ruleset is a 32-character hex code with a deterministic mnemonic name.
- **Deep pattern tooling** — hex-aware brushes, region copy/paste with 60° rotation and mirroring,
saved starting states, and a personal pattern library.
- **See the rules, not just the cells** — rule-based coloring, curated and color-vision-friendly
palettes, live entropy and population plots, and per-rule firing analysis.
- **Rewind and branch** — scrub the selected world back 240 ticks, replay it, and fork from any
earlier state.
- **3D torus view** — project the selected world onto a live torus and orbit it without changing the
simulation.
- **Export anything** — PNG/JPEG, WebM, animated GIF, seamless cycle loops, share links, and portable
`HXW1.…` world codes.
- **Auto-Explore** *(alpha)* — an evolutionary search for interesting rulesets, ranked by a
HexLife-native model that runs entirely in your browser.
## 🚀 Quick start
The easiest way in is the [**live demo**](https://sidem.github.io/HexLife/) — no install, no account.
To run it locally you need [Node.js 20](https://nodejs.org/) and a browser with WebGL2 and hardware
acceleration enabled:
```bash
git clone https://github.com/Sidem/HexLife.git
cd HexLife
npm install
npm run dev
```
Vite serves the app at `http://localhost:5173`. The compiled Wasm engine is checked into the
repository, so development mode does **not** require Rust.
| Command | What it does |
| :--- | :--- |
| `npm run dev` | Start the Vite development server |
| `npm run build` | Rebuild Wasm and create the production bundle in `dist/` |
| `npm run preview` | Preview the production bundle locally |
| `npm run test:run` | Run the Explorer's Vitest suites once |
| `npm run lint` | Run ESLint |
| `npm run typecheck` | Type-check opt-in JavaScript and declarations |
| `cargo test --manifest-path hexlife-wasm/Cargo.toml` | Run the Rust engine tests |