How a table of colored squares can grow shapes that look alive — and how “evolution” can find amazing ones all by itself.
Inspired by Stephen Wolfram’s Endless Forms Most Beautiful and Most Wonderful: Ruliobiology
Alexander Mordvintsev · znah.net
We start with one colored square. Each square in the next row looks at three squares above it: the one to the left, the one right above, and the one to the right. Then it finds that pattern in the rule table and copies the answer.
1. Patterns of three squares: left (2) × middle (2) × right (2) = 2 × 2 × 2 = 8 patterns
2. Different rules: each of the 8 patterns can have 2 possible answers, so we multiply 2 by itself 8 times:
In a symmetric rule, a pattern and its mirror image always give the same answer. Move your mouse over a pattern to see its mirror twin.
Number of symmetric rules: 575 = — still huge, but much smaller than 5125.
A mutation is a tiny change: pick one pattern in the table and give it a different answer (its mirror twin changes too). Sometimes nothing happens… sometimes the creature changes completely!
Now let the computer do it, thousands of times per second:
What score? We can choose what we want the creature to be good at:
How many rows it grows before it disappears. Long-lived creatures!
How wide it gets. Big, spreading creatures!
How many colored squares it has. Chunky creatures!
What share of its colored squares just copy the color right above them. It must live at least 20 rows. Calm, striped creatures!
One rule: creatures that never stop growing are disqualified — they must finish!
Evolving new creatures in a loop — each time a run gets stuck for a couple of seconds, a fresh one starts. Sorted with highest scores on top: