How do you grow a bush from a line of text? Take a short word and rules for replacing letters. At every step all letters are replaced at once; then the word is read as orders for a turtle with a pen: step, turn, remember this spot, go back. A dozen symbols yield a curve that fills a square, a snowflake of infinite length or a sprawling bush.
How it works
A system has an axiom (the starting word), rules and an angle. F, G, A and B step forward with the pen down, f steps without drawing, + and − turn by the angle, [ and ] save the turtle’s state and return to it, growing branches. Letters such as X and Y draw nothing and only steer growth.
The word is never written out: the turtle walks the rewriting tree, with each letter’s step count per generation known in advance. “Generations” is thus capped exactly at 400 thousand segments; 0 picks the system’s default. When the angle divides 360°, headings come from a table and the curve never drifts off its lattice. “Rounding” turns corners into arcs. For space-filling curves “Width” is a share of the step, so neighbouring runs never merge; plant branches get thinner with every level.
A bit of history
The Hungarian biologist Aristid Lindenmayer devised these systems in 1968 to model filamentous algae, whose cells divide simultaneously, like letters under the rules. The pen-carrying turtle came from the teaching language Logo, and Przemysław Prusinkiewicz married it to L-systems. His book with Lindenmayer, The Algorithmic Beauty of Plants, came out in 1990, a year after Lindenmayer’s death. The curves are older. In 1890 Giuseppe Peano built a continuous curve through every point of a square, from formulas alone, without a drawing; a year later David Hilbert gave a geometric one. In 1904 Helge von Koch presented his snowflake, a curve with no tangent anywhere. Paul Lévy described the C curve in 1938, and Bill Gosper came up with his “flowsnake” in the 1970s. The dragon was found in the 1960s by the NASA physicists John Heighway, Bruce Banks and William Harter; Martin Gardner wrote about it in 1967, and Michael Crichton used it to head the sections of Jurassic Park.
What to tweak
- “Generations” 1, 2, 3… shows each generation built from small copies of the last.
- “Gosper curve” with “Colouring” “along the path”: colour falls in patches, as a space-filling curve covers its region piece by piece.
- “Angle tweak” breaks the lattice: just 6° scatters the dragon into a cloud of curly islets and changes the spread of plant branches.
- A curve with “Width” near 0.5 under a “Relief” effect becomes a maze stamped in metal.