🐢 Turtle Graphics & L-Systems

An L-system (Lindenmayer system) is a parallel rewriting grammar invented by Aristid Lindenmayer in 1968. Starting from an axiom string and applying production rules iteratively, it generates complex strings that a turtle interprets as movement commands — F (forward), + (turn left), - (turn right), [ (push state), ] (pop state) — producing self-similar fractal structures of arbitrary complexity. 🇺🇦 Українська

Presets

L-System Rules

String length
Draw steps
Stack depth
Draw time

How L-systems Work

Each iteration applies all production rules simultaneously to every character: the string grows exponentially. At iteration 10 the Dragon Curve string is 210 = 1024 steps; at iteration 14 it's over 16 000. The key insight is self-similarity: every sub-segment of the Dragon Curve at level n looks like the whole curve at level n-1. Fractal dimension of the Dragon Curve is exactly 2 (it fills the plane); the Koch curve has dimension log(4)/log(3) ≈ 1.261; the Sierpiński triangle is log(3)/log(2) ≈ 1.585.