Place Ents (Entities) into the world, press play, and a Python file determines what happens in the next tick.
I got interested in artificial life (alife), or the idea that a few simple rules are enough to produce something that behaves like it's alive. I wanted somewhere to actually experiment with it rather than watch someone else's finished demo. So I built the sandbox I wanted with Claude.
EntLab is short for Entity Lab. An Ent is one entity, a single cell that is either there or not. The lab part is the point of this thing: nothing is hardcoded. You can change or edit the rulesets for worlds whenever.
- Rules you write. A ruleset is a single
.pyfile definingstep(world). Nine examples are included. - Drawing tools. Place, select, move, and make shapes, with brush sizes 1–10. Copy any patch and stamp it anywhere, rotating and flipping as you go.
- Go forwards or backwards in time. Every tick is recorded, so you can step backward as well as forward at many speeds, with a reset button taking you to when you pressed play last.
- Watch the population. A live sparkline of how many Ents exist makes booms and collapses legible. A minimap shows where you are on big boards.
- Boards up to 2048². Vectorized rules stay comfortable at scale. Conway runs about 2 ms per tick on a 1000 × 1000 grid. Speed goes from ×0.1 to ×1000.
- One file is a whole world. Saving writes a
.gridwith the ruleset's source embedded, so a world you send someone always runs. Drag it onto the window to open it.
| Drawing and selection | Ruleset editor |
|---|---|
![]() |
![]() |
| Population graph | World creation |
![]() |
![]() |
This is a complete, working ruleset—not an excerpt:
def step(world):
n = world.neighbor_counts()
world.cells[:] = (n == 3) | (world.cells & (n == 2))world.cells is a live NumPy array, so whole-grid rules stay short and fast.
Per-cell get / set works too, which is how you write things that aren't
cellular automata at all. The included gravity ruleset makes Ents fall and
stack, and langtons_ant is a walker that keeps its own state.
Nothing to install. The web version isn't a lookalike—it's the same Python program compiled to WebAssembly, with the same menus, tools, and keybinds. The first visit downloads a Python runtime of about 15 MB, then it's cached.
With Python 3.8+ from python.org, double-click
Launch EntLab.pyw—no console window, and the first run installs pygame and
NumPy itself. From a terminal:
python3 main.py- Name it and size it. The grid runs from
(1, 1)at the bottom-left up to whatever size you pick, 8 to 2048 cells per side. Type200 x 150, or just300for a square. - Pick a ruleset. This is the law of nature for the new world.
conwayis the classic one.tutorialis a walkthrough written as comments inside the file. - Shape and edges, if you like. A world can be a rectangle, an ellipse, a diamond, or a hexagon. A rectangle's edges can be solid walls, a torus that wraps both ways, or a cylinder that wraps left to right.
- Create world, then draw. You start holding place, so click or drag on the board to paint Ents.
- Press Space. The ruleset takes over and runs ten ticks a second.
If nothing seems to happen, you probably drew something the rule holds still. Under Conway a lone Ent dies at once and a 2 × 2 block sits there forever. Try a rough diagonal smear instead.
A ruleset is one .py file holding the law of nature for a world. Whatever it
does to world is the rule. There is nothing else going on behind it.
DESCRIPTION = "one line shown in the rulesets menu" # optional
def step(world): # required name, required single argument
... # advance the world by exactly one tickEntLab calls step(world) once per tick while playing, and once per press of
N. Rules can use:
world.cellsfor fast NumPy operations across the full gridworld.get(...)andworld.set(...)for cell-by-cell behaviorworld.rngfor reproducible randomnessworld.statefor JSON-serializable memory between ticksworld.neighbor_counts()for cellular-automaton rules
Start with the tutorial. Select the tutorial ruleset in Customize rulesets,
create a world, then open rulesets/tutorial.py in any text editor and follow
the experiments written into it. template.py is a clean file to copy, and
New ruleset from template does exactly that.
Press S to save. A .grid file holds the board, the tick count, the
ruleset's whole source, and any state the rule was keeping. That means a world
you send someone always runs, even if they have never seen that ruleset. Drag
a .grid onto the window to open it.
Because the source travels inside the file, editing a ruleset in your library never quietly changes worlds you already saved. When you do want that, use Esc → reload.
tutorialconwayreplicatormazeseedslife_without_deathgravitylangtons_anttemplate
Bug reports, ideas, and interesting rulesets are welcome in GitHub Issues.
Made by Jonah Feinberg with Claude.




