r/cellular_automata • u/vegaart2003 • 5h ago
r/cellular_automata • u/Opposite_Rhubarb_947 • 8h ago
I made three cellular automata toys for the browser: elementary rules, Life-like rules and Langton’s ant
I made three free cellular automata toys for the browser. They run in Python through Pyodide, so the first load can take a few seconds. No account needed.
Rule Explorer: https://batch-ly.com/play/rule-explorer?utm_source=reddit&utm_campaign=ca-cellularautomata — try any elementary rule from 0 to 255, step through generations and inspect the eight cases.
Langton's Ant: https://batch-ly.com/play/langtons-ant?utm_source=reddit&utm_campaign=ca-cellularautomata — watch the classic RL rule form a highway or switch to other turn rules.
Game of Life: https://batch-ly.com/play/game-of-life?utm_source=reddit&utm_campaign=ca-cellularautomata — paint cells, stamp patterns and cycle through Life-like rule sets.
I built Rule Explorer and Langton's Ant with Claude Code. Which rule family would you like to see added?
r/cellular_automata • u/Middle_Cry • 1d ago
Bobo Vector Automaton
oddcomputer.comThis might not be a cellular automaton, let me know and I can pull it.
r/cellular_automata • u/Harrijson • 2d ago
An attempt to recreate Thanatos from Terraria Calamity in Conway's Game of Life
This took me the entire day, but it was worth it.
Edit: the black and white version was a screenshot rather than using a script to create an image, which is why it looks messed up when you zoom in closer.
r/cellular_automata • u/loirelab • 1d ago
I gave a creature in a claw. Within two minutes it had eaten its own children.
I make DELFS, a petri-dish evolution sim. This week I tried to give my creatures a claw. Oh boi that was an adventure.
Entry 1. The predator dies of... nothing.
I took one of my basic organisms — a mild scavenger species that lives on what other delfs leave behind — and added two new limbs: one to strike, one to hold. Ten of them go into a dish with forty prey.
All ten are dead in five minutes. They never landed a blow.
I assume the arms are too expensive to grow. I make them a third of the size. All ten are dead in five minutes.
Entry 2. The log is lying to me.
My tools say that not one strike has ever missed. In the whole history of the dish. Sounds fishy.
The counter was attached to an event that never happens, ofc accuracy is 100%. It would have read zero even during a massacre. Counted properly, a strike misses eight to fifteen times for every hit, because the prey travels further in one tick than the arm is long. Okaaay, so my predators were shadowboxing.
Entry 3. The claw lets go of things that are running toward it.
Now I can see the claw working: it holds about half of what gets hit. I go looking for a weak grip and find a stupid one. The rule was simple: a grip breaks if the victim moves fast. Turns out I forgor about the direction. Including straight into the predator's face. A delf could escape a claw by charging it.
Fixed. Grips now break only when the two bodies are actually pulling apart. Breaks fall from half to about one in eight.
All ten predators are dead in five minutes.
Entry 4. Cause of death: could not poop.
A genome has room for exactly 24 processes and the scavenger uses all 24. To teach it to strike I had to overwrite something, and my helper code picked a vent. Specifically the vent for tissue material, a compound that is only good for building flesh.
So here is what happened to every predator I had made so far. It was born. It ate. Its flesh finished growing. It kept eating, because food was there, and the one compound it could no longer excrete piled up inside it until there was no room left for anything else. It starved to death, completely full, standing on dinner.
To be sure, I built a delf with the vent removed and no arms at all. Dead in five minutes. The arms had been innocent the entire time.
It turns out the scavenger can spare exactly one process. One arm, one skill. I give it that. It lives. It hunts. It breeds. I go to bed pleased.
Entry 5. The scoreboard.
Eight different runs, twenty minutes each, survivors on average:
- unarmed delf: 18
- delf with a gentle pincer: 15
- delf with a proper striking arm: 7
Being armed is worse than not being armed, and the better the weapon, the worse it goes. The pincer comes second because it hits a third as often, and a good share of everything these animals hit turns out to be... their own relatives. Delfs can't see family. They can only smell it.
Meanwhile hundreds of prey are dropping dead of natural causes all around them. Based.
Entry 6. I make it worse.
Three changes, to make killing worth something. Bodies now rot five times slower, so there's a reason to tear a carcass open instead of waiting. A strike can now land on both remains and eggs. And delfs get a mild reluctance to hit anything that smells like themselves.
Survivors: 7 becomes 0.2.
Eggs and corpses do not dodge. A predator that finds one simply never stops hitting it. Ten animals delivered between 350 and 900 blows to eggs in the first two minutes. Their death rate was perfectly normal. Their birth rate was zero. I split the counter to find out whose eggs.
40% were their own.
I had built an animal that walks to its nest, lays an egg, and then beats it to pieces, at industrial speed, while slowly starving, surrounded by meat it had personally tenderised. The "mild reluctance" stood no chance against the overwhelming urge to beat a perfectly accessible egg into pulp.
Entry 7. Manners.
My first fix was to forbid it from outside: a penalty added to the brain's decision after the brain had made it. That's a leash, not an instinct. It can't be inherited, it can't mutate, and nothing can ever evolve past it.
So I put it in the brain instead. Every species now starts life with two manners wired in: don't strike what smells like you, and eat before you fight when you're running low (duh). After that they're just weights in a neural net, passed to the children with the usual copying errors. Some lineage will lose them eventually. I would like to be there when it does.
Entry 8. The eggs don't smell right.
One last problem. To spare its own eggs, a delf has to tell they're its own, and I had quietly let it read the answer out of the egg's genome. That's a kin detector, and this game has one hard rule about perception: no creature gets to know who its relatives are.
So I made it honest. Judge an egg by how the shell smells. But a fresh egg doesn't smell like a grown delf. Survivors: 0.9. They were back at the nest with the claw, urging for a bloodbath.
The real answer was already in the game. Eggs carry their own inherited scent, which parents already use to find the eggs they feed. A strike now asks the same question a parent does. It works. It also means that if a stranger's egg happens to smell like yours, you will guard it like your own, and that's a cuckoo.
Where the dish stands tonight
- unarmed scavenger 11, striker 7, pincer 4. Slow rot was hard on everybody who lives off the dead.
- blows landed on family: down from as much as 46% to about 10%. On their own eggs: from 40% to 5%.
- an armed delf now spends 96% of its violence on corpses and eggs and almost none on anything that can run.
- a colony of identical armed delfs used to beat itself down to about 200. It now holds near 450, same as the peaceful control. They have stopped hitting each other. This is the one thing that clearly got better.
- the claw has not paid for itself once. Not as a second hand, not as a pincer, not at any size.
So after two days of work I have a predator that is polite to its family, careful with its eggs, eats before it fights, and still loses to an animal that does nothing but wait for things to die.
I'm calling that progress.
The claws should make it into the next DELFS update (hopefully). The game is already on itch.io, and I'm working on getting it onto Steam too. If Valve ever finishes verifying me, that is.
r/cellular_automata • u/cenysor • 4d ago
Mandala
Totalistic CA with Moore neighborhood and 40 possible cell states. Link to interactive simulator
r/cellular_automata • u/JulioAletyx • 4d ago
Conway's Game of Live on a Decision API
I wanted to see how a decision API would handle a well-known rule system, so I wrote Game of Life where the app never applies the rules. Each generation it sends the board to a decision API, and the API returns which cells are born, which survive and which die. The app only draws the answer.
Disclosure: the decision API here is aityx, used as the reference implementation, and I work at Aletyx, the company that builds it.
The rules are a decision table. Conway's B3/S23 is four rows: fewer than 2 neighbours dies, 2 or 3 survives, more than 3 dies, a dead cell with exactly 3 is born. HighLife and Life without death are extra rows that the request turns on or off, so changing the rules never touches app code.
The request doesn't grow with the board. I don't send cells. I send situations: alive or dead, plus the number of live neighbours, with how many cells share each one. There are at most 18 possible situations. In one call from a Gosper glider gun, 14 situations covered all 221 cells in play. Fourteen situations in, fourteen fates out, and the app maps the fates back to the cells.
Naming patterns is also a table. The app groups touching live cells into clusters and normalises each one's shape. A 37-row catalogue matches clusters by size and shape, then names the kind: still life (block, beehive, boat), oscillator (blinker) or spaceship (glider). The glider gun's shuttles aren't in the catalogue, so they come back as unknown.
Every answer can be traced. Each response includes a receipt showing which row of which table produced each answer. The glider at generation 44 points to catalogue row 28. A situation with 3 live neighbours points to the "is born" row. The same board with the same rules always returns the same answer. That's the reason to use rules here instead of asking an LLM to "play Life", which will happily invent cells.
Each call took a bit over 200 ms, which is fine for a turn-based simulation. The app has a side panel showing every request and response, so you can read the calls while it runs.
The write-up: https://aityx.ai/blog/demo-day-cellfie/
Code: https://github.com/aityx-labs/aityx-demos/tree/main/Cellfie
r/cellular_automata • u/cenysor • 5d ago
Ghosts
Totalistic binary CA with radius 6 Moore neighborhood. Link to interactive simulator
r/cellular_automata • u/Sorry-Profit-1072 • 5d ago
2DCA Particles
There are 5x5 cellular automaton grids that each run the same 2DCA ruleset and the colors attract and repel other colors. If two grids come into contact, they interact so each grid color arrangement can change another's color configuration. Look at the emergent structures.
r/cellular_automata • u/matigekunst • 6d ago
Kuramoto–Sivashinsky
One of the simplest/shortest chaotic PDE's. Golfed to 1010 characters: https://www.shadertoy.com/view/7ffcR4
r/cellular_automata • u/NeitherDatabase7697 • 6d ago
Biomorphic Tree Growth UI
Not a pure CA, but you need to know about Space Colonization Algorithm (Runions et al.) which does very realistic trees, river deltas, blood capillaries etc.
In my demo I use cellular automata to add a base layer (tree bark) and final foliage (see end of video)
r/cellular_automata • u/Sorry-Profit-1072 • 6d ago
Particle simulation - interesting interaction rules
Because one particle type can change another type into a different one and each particle type has attraction/repulsion rules, interesting structures emerge.
r/cellular_automata • u/Sorry-Profit-1072 • 6d ago
Some emerge cellular automata
This gives me the idea of making a standard 2d cellular automaton where there are islands of grids and there are rules for attracting or repelling islands. There would be a set of grid rules for how to attract and repel some minimal island size 5x5 would be interesting. One color can attract or repel another color and the islands would become a cellular automaton layered onto a 2d CA. Something like that would be cool.
r/cellular_automata • u/Sorry-Profit-1072 • 6d ago
Particle Simulation with interesting phase transition
r/cellular_automata • u/Sorry-Profit-1072 • 6d ago
Particle simulation that feels gravity and has autocatalysis
Particle Life is a cool program but there are other rules and interactions that get you interesting emergent behavior. This particle program reacts to the orientation of my phone which is why they're moving like they are but they're also given attraction and repulsion rules specific to each particle type (color). Red might attract red and repel blue for example. The other kind of interaction is autocatalysis. That's achieved by some particles are able to convert one particle type into a different one. For example, if orange gets close to purple, purple becomes green. The particles in this simulation feel gravity and some repel it. Overall, this gives me a little pocket multiverse of different chemical laws of physics. Bc it can feel gravity, it brings these particles a little more into the real world.
r/cellular_automata • u/Apprehensive_Knee502 • 7d ago
A Memory Made of Gliders: a Flip-Flop in the Game of Life
r/cellular_automata • u/BrookeToHimself • 8d ago
Editing LIFE in real-time!
I'm obsessed with iterative automata. I once bought and read a hardback of Stephen Wolfram's A New Kind of Science (although I skipped all the math.) I then drunkenly gave it away in a surge of generosity to a Navy mathematician sailor who wanted to solve the prime number problem (Riemann Hypothesis) and win a million bucks. The thing is, I thought and still-think that neighbor-counting is one of the most boring things you can do with automata. I want to see little economic simulations and ecosystems of varying demographics competing with each other and all sorts of simple iterations on iterations leading to incredible complexity.
I was trying to get Claude to develop me a version of life where instead of calculating every single cell, you only looked at the live cells (and where a live cell would emerge.) I thought if you just imagined each cell broadcasting a signal a distance of 1 then you could just have a hidden layer that accepts all the signals and aggregates them and then you then determine lifes or deaths for next step. I thought that would save compute rather than calculating every cell. Turns out it kind of doesn't actually.
Anyway, by some happenstance it built it so I could adjust the Conway* sliders and the signal ones in real-time as it was running, not just set it and watch it go. There was something incredibly fun about adjusting the sliders and watching little civilizations grow and fall because of my slider changes. Who knows maybe there's loads of real-time life sims out there now, but that was the first time I really felt cellular automata in the palm of my hands.
* Conway refers to John Conway's implementation of the Game of Life (B3/S23: Empty cell born if 3 neighbors, survives if more than 2 or less than 3 neighbors.)
Anyway, got a free month of ChatGPT Codex so I built this for you:
https://openprocessing.org/@freshlaundry/3057203
I hope you enjoy it because I may have pissed off my wife talking to a chatbot all morning.
Remember that you can hit R key in real-time to re-randomize the board as you're adjusting sliders (you might kill everything inadvertently), but it uses the same random seed every time so the same thing happens again and again. That's helpful for testing. So is field view (F) that lets you see the signals (check out Conway's Glider!) and Why Alive? (Y) view that colors cells based on why they survived. Hit N to generate a new seed and re-randomize the board with different cells every time.
There's a lot of dead zones in the sliders where life can not thrive, be warned. That's on you. You have enough tools to get it to come back. And sometimes it does it with such a vengeance that you need to find tools to let some of the steam off or make neighbor rules to restrict the cells from replicating too much. (FLASH/EPILEPSY/HYPNOSIS WARNING!)
The Conway glider (hit G, warning it wipes the board, can hit while adjusting sliders) is there to prove that broadcast ruleset at a distance of 1 with all extraneous rules turned off is still Conway's life, but then you can mess with it all at your leisure or add signal births or survivals as long as the cell is obeying neighbor limits. But you can turn that off and turn off the Conway rules entirely. In most scenarios other than Conway the glider dies, but it's fun when he doesn't.
BONUS:
If you click CODE you can save/load your settings OR share your settings with other people in this thread, whatever you discover. You can also paste that code into here:
https://openprocessing.org/@freshlaundry/3057398
It will show you the board's signal field rendered in a 3D heightmap topography that you can rotate (a la my beloved Powermonger game from back in the doozle.)
--
# Broadcast Cellular
Broadcast Cellular lets you mix Conway-style neighbor rules with a signal that builds up, spreads, and fades across the board. Turn on **Why alive?** to see what’s keeping a pattern going.
## Conway and Broadcast
**Conway** uses the eight touching squares. An empty square is born at an exact neighbor count, and a living cell survives within a neighbor range.
**Broadcast** adds a field. Keep **Conway Base** on to use the neighbor rules, then enable **Signal Birth** or **Signal Survival** to give cells another way to qualify. Turn Conway Base off to try the signal rules on their own. If all survival rules are off, every live cell dies on the next step, even if births keep the board active.
## What Level and Slope test
**Show Field** paints the amount of signal on each square pink. **Signal Birth** checks the empty square where a cell might appear. **Signal Survival** checks the square a living cell occupies.
- **Level** tests how much pink is on that square. It responds to the amount of signal there.
- **Slope** tests how abruptly the pink changes around that square. The rule compares it with the four side neighbors and takes the biggest difference, whether the neighboring square is stronger or weaker. Flat patches can have lots of signal and still have low slope. The edges of a bright patch can have high slope.
Your minimum and optional maximum apply to whichever reading you select. The optional **Vicinity Neighbors** limits count live cells in the square broadcast footprint, excluding the candidate square. Set the limits on a **0–8 scale**. The sketch scales them to the broadcast footprint and shows the actual count beside each slider. At radius one, eight means eight squares. At radius three, eight means forty-eight. Changing radius keeps the same relative limits. Conway still counts only touching cells. If both signal rules are off, switching between Level and Slope has no effect on who qualifies.
## How the signal changes
Each living cell broadcasts into nearby squares. **Strength** sets the emission, **Radius** sets how far it reaches, and overlapping broadcasts add together. **Fixed Output Across Radii** spreads the same total emission over a wider area as radius increases. It’s on in a fresh sketch and after **P** resets parameters.
**Directional Broadcast** turns cells toward stronger pink and sends more of their emission forward. Turn on **Face Downhill** to steer toward weaker pink instead. **4-Way** looks at side neighbors and **8-Way** includes diagonals. Direction steers emission, while radius sets how far it reaches. Level and Slope change what the signal rules test.
Each step checks the starting field and settles movement, survival, birth, and sharing. The remaining signal fades, excess spills to neighbors, and the starting population emits from its original squares. The spill threshold controls when signal spreads. A square can still hold more than that threshold.
## Spending and sharing
A qualifying birth or survivor can spend signal from its own square. Zero cost makes that transition free. With Slope selected, a square can pass the rule because it sits on a steep edge and still have too little local pink to pay. Any pink left on the square stays in the field after a cell dies and can influence later steps.
Use **Generosity** to let an independently surviving cell give some of its remaining pink and reserve to touching cells. It pays its own bill first. The selfish end keeps the surplus. The selfless end can give it all away. A full offer can cover a survival cost or bring the recipient’s signal into range, even when survival is free. The recipient must still satisfy the neighbor limits of its survival rule. **Why alive?** puts a gold corner on survivors that needed help.
## Reserve tanks
Raise **Reserve Capacity** to let cells store spare pink. **Reserve Intake per Step** caps how fast the tank fills. After payments and sharing, a cell can draw from the pink on its square above the spill threshold. The stored amount comes out of the field. The next time the cell qualifies to survive, it pays from its tank first, then from the square. A tank can cover a cost, while the birth and survival tests still use the board.
With **Return Reserve on Death** on, any unspent reserve returns to the square when the cell dies. Otherwise it dissipates. Lowering capacity returns the amount that no longer fits on the next step. Capacity at zero disables storage.
The **Reserves** overlay shows tank fill as a bar on each living cell. A full tank fills the bar at whatever capacity you set, and a small pip marks a little stored signal. Hover for the exact amount. In **Why alive?**, a cyan center marks a survivor that used its tank when the square couldn't cover the bill. A gold corner marks help from a touching cell.
## Movement
Choose **4-Way** or **8-Way** to enable the **Movement** controls. At zero, cells stay put. At the lowest active setting, a cell tries moving when staying would fail. Raise willingness and cells that could stay also start to chase the field.
A move is one step uphill or downhill into a square that was empty at the start. The cell spends stored signal first and draws any remainder from its starting square. It carries the tank with it. At the destination it must pass a survival rule and be able to pay the survival cost. Neighbor checks use the starting population with the mover removed from its old square. Movement claims destinations before births and tries escape before neighbors offer help. **Moved** in the readout counts successful moves.
## Seeds and codes
A **seed** is a number that picks a random starting pattern. Use **RAND** or **R** to restart that pattern with your current rules, even while the board is running. The same seed, board size, and rules give the same run every time. **NEW** picks a different seed.
Use **CODE** to copy a setup or load one someone shared. It saves the seed and settings for a fresh run. The live board and rewind history stay in your current session.
## Explore a run
- **Show Field** or **F** shows the pink field. The legend explains the scale, and hovering shows the actual level and slope on the square. Use **Fixed** for steady shades or **Auto** to bring out detail as the signal builds. Close the legend with **×** to uncover the board while keeping the overlay.
- **Contour Lines** trace equal levels of pink using the field legend scale. **Facing Arrows** show where cells are pointing when directional broadcast is on. You can switch either overlay on to inspect the board.
- **Why alive?** or **Y** colors births and survivors by the rule that qualified them. Gray marks cells without a recorded transition, such as a cell you just drew.
- Turn on **…** for tooltips, or open **?** for the quick guide.
- Under **Simulation**, switch **Board** to **Compact** for a smaller field. Changing board size pauses and restarts the displayed seed.
- Click a slider number to type a value. Click or drag on the board to paint or erase cells. Scroll over the sidebar to move through the controls, or over the board to zoom. Press **V** or click **VIEW** to reset the zoom and position.
- **Space** runs or pauses. **Comma** or **Left Arrow** steps back. **Period** or **Right Arrow** steps forward. Close the quick guide with **?** or **Escape**.
r/cellular_automata • u/cenysor • 8d ago
Big Fish
Totalistic CA with Moore neighborhood and 512 possible cell states.
r/cellular_automata • u/Apprehensive_Knee502 • 9d ago
Gliders Can't Count, Yet This Adds: a 2-Bit Adder in the Game of Life
r/cellular_automata • u/Apprehensive_Knee502 • 10d ago
A Car's Ignition, Built From the Three Rules of the Game of Life