aldus.nexus

Evolution

A terminal-style genetic algorithm lab: evolve pixel sprites, the words aldus nexus or walking creatures from noise.

genome feed

The numbers

best and average fitness
diversity
mutations per generation

How it works

A genetic algorithm keeps a population of guesses and never looks at the answer directly. Each sprite genome is 256 hex digits, one per pixel, each naming one of nine colours. Fitness is simply the share of pixels that already match the target.

Every generation, selection picks parents, fitter ones more often. Tournament picks three at random and keeps the best; roulette spins a wheel weighted by fitness. Crossover splices two parents into a child, mutation changes a few digits at random, and elitism copies the best few across untouched so progress is never lost.

Weasel mode is Richard Dawkins's 1986 thought experiment with a nexus twist: random letters climb to "aldus nexus" far faster than blind chance ever could. God mode hands selection to you: switch to it mid-run to take the wheel from the machine, or start from pure noise with a new batch.

Walkers mode evolves bodies instead of pictures. A genome of 50 bytes builds a creature of 3 to 6 nodes, every pair joined by a spring. Some springs are bones; the rest are muscles whose rest length swings on a sine with its own evolved phase and size, all at one evolved beat. Each node has its own grip on the ground, and a creature only moves forward if its feet slip one way and hold the other.

Every creature is dropped on flat ground and run through a hand-written physics loop, 120 fixed steps a second: add up the spring forces, add gravity, move each node, then stop anything that sinks into the ground and let friction push back on its sideways speed. Fitness is simply how far its centre moved to the right in the time you set. The same selection, crossover, mutation and elitism controls then breed the next generation, and the best walker of each one is replayed in neon with its trail.

Nothing in the loop knows what a frog looks like. Blind copying plus a slight preference for better is enough to build one.

f(g) = (1/256) Σ [ gi = ti ]fitness: the share of genes g that match the target t
P(i) = (fi − fmin) / Σj (fj − fmin)roulette: the chance genome i is picked as a parent; tournament keeps the best of 3 random picks
p(change) = μ per genemutation: about μ × 256 digits change in each child
F = -k (|x| - L(t)) x̂ - c vwalkers: each spring pulls back toward its length; c damps the wobble
L(t) = L₀ (1 + a sin(2π f t + φ))a muscle: evolved size a, phase φ and beat f; bones have a = 0
|Δvx| ≤ μ Jnground friction: sideways change is capped by grip μ times the landing push
f = x̄(T) - x̄(0)walker fitness: how far the centre moved right in T seconds

Speedrun records

Fewest evaluations (population × generations) to a perfect match, per character. Par is 25,000.