L-System Plant Growth Screensaver
The L-System Plant Growth screensaver grows branching plant structures using real Lindenmayer-system fractal grammar, the same technique used to model real plant growth. It is free, runs in your browser, and ESC exits.
How the L-System Plant Growth screensaver works
The saver applies a real Lindenmayer-system (L-system) rewriting grammar to generate a branching plant structure.
Each growth cycle expands the grammar one more generation, adding new branches and leaves.
Once a plant reaches full growth, it fades and a new random L-system grammar begins growing elsewhere.
This is the same real grammar-based technique botanists and graphics researchers use to model plant growth.
Lindenmayer's grammar for growing plants
L-systems were introduced in 1968 by Aristid Lindenmayer, a Hungarian theoretical biologist and botanist at the University of Utrecht. He first used them to model simple multicellular organisms such as the cyanobacterium Anabaena catenula, as well as yeast and filamentous fungi, and later extended them to higher plants. The method is a string-rewriting system: you start with a short seed string and a set of rules, and at every step every symbol in the string is replaced at the same time according to the rules.
To draw a plant, the symbols are read as instructions for a turtle, an imaginary pen. One letter means move forward and draw, plus and minus mean turn left or right, and a pair of brackets means save the position and angle and later restore them, which is what makes branching possible. A single rule that replaces a segment with a segment and two side branches produces a tree after a few iterations, and the shape becomes more complex with each one.
The book The Algorithmic Beauty of Plants, by Przemyslaw Prusinkiewicz and Lindenmayer, presents this approach to modelling plant form. L-systems are used in computer graphics, in generating self-similar fractals, in artificial life and architectural design, and even in music generation. They describe form, not biology, and real growth also depends on light, water and genetics.
A worked example
A single stem splits into two branches, each of which splits again, quickly building the same self-similar branching seen in real ferns and trees.
Settings & tips
- Accent recolours the branch and leaf tips.
- Based on the real Lindenmayer-system grammar used in botanical modeling.
- A new random grammar begins each growth cycle.
Frequently asked questions
- Is this based on real botany research?
- Yes — real L-system grammars, first developed to model real plant growth patterns.
- Is a key needed?
- No — it is a pure local simulation.
- Is it free?
- Yes — free, no download, in your browser.
- Does every plant look the same?
- No — the grammar rules vary each cycle, producing different branching structures.
- How do brackets create branches in an L-system?
- An opening bracket saves the current drawing position and angle, and a closing one restores the most recently saved state, so the turtle can draw a side branch and then return to continue the main stem.
- Why do the shapes get more complex each generation?
- Every symbol is replaced at once, so the string grows rapidly, often exponentially, and each new generation adds more detail on every branch.
- Can L-systems model things other than plants?
- Yes. They generate self-similar fractals, have been used in artificial life and architectural design, and have been applied to music generation.