r/cellular_automata • • 33m ago

Dúvida sobre a formiga de Langton

2 Upvotes

Dúvida sobre o comportamento de duas formigas de Langton

Estive experimentando um simulador da formiga de Langton e, durante alguns testes, observei um comportamento que despertou minha curiosidade.

Ao posicionar duas formigas simultaneamente, seja na diagonal ou horizontalmente, percebi que, aparentemente, independentemente da distância inicial entre elas, ocorre um ciclo periódico.

Em determinado momento, as duas formigas acabam se encontrando e passam a se deslocar no sentido contrário, aparentemente refazendo seus caminhos até retornarem às posições iniciais. Em seguida, reproduzem o mesmo padrão de movimentação, mas invertido. Posteriormente, voltam a se encontrar, repetem o processo e reiniciam o ciclo.

Outro detalhe interessante é que esse comportamento também ocorre quando as formigas não começam a se movimentar ao mesmo tempo. Mesmo que uma delas seja iniciada antes e a outra comece posteriormente, o ciclo se estabelece da mesma maneira. Além disso, não observo um comportamento caótico ou imprevisível decorrente da interação entre elas: o padrão permanece organizado e periódico.

Tenho uma hipótese: será que, quando duas formigas se encontram, ocorre alguma espécie de inversão em seus padrões de movimentação? Seria essa interação responsável por fazê-las inverter o sentido e iniciar o ciclo novamente?

Minha dúvida é: por que isso acontece? Existe alguma propriedade matemática ou característica das regras da formiga de Langton que explique esse comportamento, especialmente a aparente inversão dos padrões quando elas se encontram?

Langton's Ant · Cellular Automata · Multi-Agent Systems · Emergent Behavior · Dynamical Systems · Mathematical Patterns · Periodicity · Reversibility · Computational Mathematics · Complex Systems
Formiga de Langton · Autômatos Celulares · Sistemas Dinâmicos · Comportamento Emergente · Padrões Matemáticos · Periodicidade · Sistemas Complexos


r/cellular_automata • • 13h ago

Automaton Worms: 1D CA structures

21 Upvotes

r/cellular_automata • • 1d ago

A mechanical computer that runs the Rule 110 CA

127 Upvotes

r/cellular_automata • • 1d ago

Every pixel in this 8-minute music video follows a rule. No footage on screen, no effects, just math (cellular automata, 104 rule sets)

0 Upvotes

The whole video is a 640 x 360 grid of cells. Each cell holds one of 8 palette colours and changes only by a written rule, like "become colour 3 if at least two neighbours are colour 3".

There are 104 rule sets, each seen once, all written in set notation. The song's MIDI drives them: piano and bass notes pick colours and columns, some sets only step on sixteenth notes or triplets, some read their own past like a reverb.

The sacred geometry is 50 line drawings fed in as distance maps. Rules can read how far a cell is from the nearest line.

The camera is not a camera. It is a rule that moves cells.

Video: https://youtu.be/45zx-2_azco


r/cellular_automata • • 4d ago

Breathe, Breathe in the Squares

5 Upvotes

Two alternating incantations breathe in and out thereby driving the creation of larger and more amorphous squarish spaces.

Three dimensions, 10000 colors, 1920x1080x10, Moore neighborhood of size 1, continuous values, asynchronous (0.8) updates, toroidal edge, initialized with random (zeroweight=0.99), weighted-avg rendering, prelude 0, transition 0.0

Incantation:
50/0.3745690872161135;0.979111412150381:gi i ya ko je gi po zu8 ma ro3 zu ro2 shi bi a5 yu re ki ki zu4 pe ma ta
30/0.9772308521249234;0.9:ge ki go ho zu15 zo mu mu jo


r/cellular_automata • • 4d ago

100K Automaton Worms

26 Upvotes

r/cellular_automata • • 4d ago

3D Cellular Automata Lab built with Fable 5.2

Post image
0 Upvotes

In high school (early 90s), I had the "James Gleick's Chaos the Software" package and my favorite thing to play with were the Cellular Automata. I always wanted to play with it in 3D or even higher dimensions. Fable 5.2 made that happen: https://www.cellumata.com .

What it does

  • Grows 3D forms from simple neighbour-count rules (like 445), plus five other families: cyclic scroll waves, reaction–diffusion, sandpiles, fire/epidemic spread, and 2D rules stacked through time

  • Rotate it, then cut it open: cut-away, thin slabs, layer by layer

  • A "butterfly test" runs a hidden twin with one cell flipped, so you can watch chaos (or healing) happen live

  • Learn tab with 8 short chapters; Explore tab with guided experiments that notice when you've actually done the thing

  • Export a poster of whatever you've grown

How it's built

Plain JS and raw WebGL2. No framework, no build step, about 4,500 lines. Claude Code also wrote a check script (66 checks) that tests the science the lessons claim. For example, it confirms the Bays 5766 glider really moves one cell diagonally every 4 ticks. It also screenshotted every layout in headless Chrome to prove no panel covers the 3D view.

You can share your CA setup

Press Share setup in the web app to copy a link to your exact rule and seed.

Would love to check out what you grow and what you find interesting in it. All comments, feedback appreciated.


r/cellular_automata • • 5d ago

I made three cellular automata toys for the browser: elementary rules, Life-like rules and Langton’s ant

6 Upvotes

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 • • 5d ago

Connecting people who enjoy exploring complex systems

Thumbnail reddit.com
2 Upvotes

r/cellular_automata • • 5d ago

Bobo Vector Automaton

Thumbnail oddcomputer.com
3 Upvotes

This might not be a cellular automaton, let me know and I can pull it.


r/cellular_automata • • 6d ago

An attempt to recreate Thanatos from Terraria Calamity in Conway's Game of Life

Thumbnail
gallery
10 Upvotes

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 • • 6d ago

I gave a creature in a claw. Within two minutes it had eaten its own children.

0 Upvotes

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 • • 8d ago

Automaton Worms

10 Upvotes

r/cellular_automata • • 9d ago

Mandala

6 Upvotes

Totalistic CA with Moore neighborhood and 40 possible cell states. Link to interactive simulator


r/cellular_automata • • 10d ago

Ghosts

7 Upvotes

Totalistic binary CA with radius 6 Moore neighborhood. Link to interactive simulator


r/cellular_automata • • 9d ago

Conway's Game of Live on a Decision API

0 Upvotes

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 • • 10d ago

2DCA Particles

8 Upvotes

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 • • 11d ago

Kuramoto–Sivashinsky

127 Upvotes

One of the simplest/shortest chaotic PDE's. Golfed to 1010 characters: https://www.shadertoy.com/view/7ffcR4


r/cellular_automata • • 11d ago

Biomorphic Tree Growth UI

33 Upvotes

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 • • 11d ago

Particle simulation - interesting interaction rules

44 Upvotes

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 • • 11d ago

Some emerge cellular automata

19 Upvotes

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 • • 11d ago

Particle Simulation with interesting phase transition

11 Upvotes

r/cellular_automata • • 11d ago

Particle simulation that feels gravity and has autocatalysis

4 Upvotes

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 • • 11d ago

A Memory Made of Gliders: a Flip-Flop in the Game of Life

Thumbnail
youtu.be
3 Upvotes

r/cellular_automata • • 12d ago

wormy

28 Upvotes