Tool · Playground
L-system editor
Build your own Lindenmayer system. Write an axiom, write rewrite rules (deterministic or stochastic), set the turtle angle and recursion depth, and render. Branching ([ ]) and a random seed for stochastic rules are first-class.
Presets:
string length = 1,792 chars
Grammar
Turtle
Turtle commands
F/G— forward + drawf— forward, no draw+/-— turn left / right by angle[/]— push / pop turtle state (branches)- Any other letter — used as a state symbol, drawn as no-op
Tips
- Deterministic vs stochastic: write one RHS per symbol for classic L-systems; pipe-separated weighted RHSs (
0.5 X | 0.5 Y) for stochastic ones, which model natural variation in plants. - Branching grammars need
[and]. Without branches you can only draw curves, not plants. Push state, draw a sub-branch, pop back to where you were. - Watch the string length. Most L-systems grow exponentially. Crank depth carefully — the renderer caps at ~5M chars and the screen usually saturates well before that.
- Read Prusinkiewicz & Lindenmayer's The Algorithmic Beauty of Plants for the full toolkit (parametric, contextual, and stochastic L-systems). The basics are all here.
The preset-only viewer lives at /tools/lsystems, and the reference page at /fractals/lsystems.
FAQ