Ruliobiology

Growing creatures from tiny rules

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

How a new row is made

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.

Rule table Top: the 3 squares we look at · Bottom: the answer.
Click an answer to change it!

How many patterns — and how many rules?

Colors:

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:

Mirror rules like a butterfly 🦋

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.

25own mirror (left = right)
5 × 5
50mirror pairs
(125 − 25) ÷ 2
75choices we really make
25 + 50

Number of symmetric rules: 575 = — still huge, but much smaller than 5125.

What this rule grows:

Mutation: change one answer

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!

or click any answer square
0lifetime (rows)
0width
0mass (colored squares)

Evolution: keep what works

Now let the computer do it, thousands of times per second:

🎲Mutate
change one answer
→
🌱Grow
run the rule
→
📏Measure
give it a score
→
✅ / ❌Keep or undo
keep if not worse
↺

What score? We can choose what we want the creature to be good at:

⏳ Lifetime

How many rows it grows before it disappears. Long-lived creatures!

↔ Width

How wide it gets. Big, spreading creatures!

⚖️ Mass

How many colored squares it has. Chunky creatures!

😴 Lazy

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!

Let’s evolve! symmetric rules, 5 colors, starting from an empty table

Make it better at:
Speed
1score
0mutations tried
0improvements
Every improvement — click one to look at it:

Endless forms most beautiful

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: