How it works
Diffusion-limited aggregation, and it needs less code than anything else here. There is a seed. A particle is released some way from it and takes a random walk — no direction, no memory — until it comes within a set distance of something already frozen, at which point it freezes too. Then the next one. Nothing in the algorithm knows what a branch is.
The branching is entirely a consequence of one fact: a wandering particle is far more likely to meet a tip than a crevice, because the tips get in the way first. So a tip that gets slightly ahead catches more of what comes past, which puts it further ahead. The lead compounds, and the result is the dendrite — a shape whose arms are thin not because anything thinned them but because the space between them is screened. Turning the stickiness below one is the counterweight: a walker that declines to freeze on first contact gets a chance to slide down into a crevice, and the cluster fills in solid instead of branching.
The naive version spends nearly all of its time following particles nowhere near the cluster. This one takes a step proportional to its distance from the cluster’s outer radius, which is exact rather than approximate — a walk that far out is equally likely to arrive from any direction anyway. The release ring and the abandon radius both follow the cluster as it grows; a fixed release ring ends up inside the thing, and a fixed abandon radius starts throwing away most of the particles. Seeding from the bottom edge instead of a point changes the picture completely, because the particles then rain down on a front rather than closing in on a target.