A pit full of snakes, all playing snake at once. None of them were trained. Each snake plays by a handful of numbers I call its genes. Snakes that eat enough split in two and hand a slightly changed copy of their genes to the new half, so over a few thousand steps the genes drift toward whatever keeps a snake fed.
A snake can turn left, go straight, or turn right. It gives each of those three squares a score and moves into the one that scores highest. Five genes go into the score:
sight. How strongly it's
drawn to the nearest egg it spots is appetite. A square gains
appetite ÷ (1 + its distance to that egg), so squares closer to the egg
score higher.wariness.
How strongly it avoids them is caution. A square loses caution ÷
the distance from it to the first wall or body ahead.jitter.A square with a wall or a body in it is never picked unless all three are blocked, which is how snakes die: boxed in. Below, one snake picks its moves. Before each step it pauses on its three squares with their scores; the highlighted square is the one it picks, a red × is blocked, and the circled egg is the one it's heading for.
Call sight, appetite, wariness and
caution a snake's senses. If better senses were free, every snake would evolve
all four to the maximum, so they cost energy. Every move burns 0.02 of a square, plus 0.06
times the combined strength of the four senses, which runs from 0 with all of them off to 2
with all of them maxed. So a snake with every sense maxed burns 0.14 a move, 7 times as
much as one with none. Below are two snakes with no food, starting the same length and
driven around the same loop, so the only difference is how fast they shrink: on the left
every sense is maxed, on the right every sense is off.
The last gene, maturity, is the length a snake grows to before it's likely to
have kids. Once a snake is at least 12 squares long, each step it splits with chance
0.02 × (length ÷ maturity)². A snake at exactly its maturity
length splits on 2% of steps, and one twice that long on 8%.
The front half stays the same snake with the same genes. The back half becomes a new snake heading the same way, with its head where the cut was, and every gene nudged a little at random. A snake's color is worked out from its genes, so relatives look alike and the new half comes out a slightly different shade. Below, a 14-square snake splits, and the new half is outlined:
Nothing scores the snakes or picks winners. Snakes whose genes keep them fed long enough to
split leave more copies, and the rest starve or get boxed in. The bars in the top left show
each gene's average over every living snake, and that selection alone moves them. In my
runs jitter falls close to zero, caution stays low, and
maturity usually comes down from the 22 it averages at the start. In
some runs it falls below 12, the shortest length that can split, so snakes there have kids
as soon as the rules allow.
The tree button opens the family tree: every snake is a line from the step it was born to the step it died, and each split starts a new line branching off its parent's. Within a few thousand steps, one of the 30 starting snakes is usually the ancestor of every snake in the pit.
This is a remake of my 2019 genetic steering sketch, where creatures evolved how hard to chase food and avoid poison.