This page can draw an L-System from a given ruleset and axioms.
This works by starting with an initial string, called the axiom, and then applying transformation rules to it.
For example, if the axiom was F
and the ruleset was a single rule, F → FRF
, a single
application of the ruleset would convert the axiom to FRF
. A second application would give FRFRFRF
since the two F
s would be replaced. In the case of conflicting rules, e.g. F → FR
and F → FL
,
the choice of replacement is random which can result in interesting patterns.
One way of visualizing an L-system is interpret the characters as drawing commands ala Logo and Turtle Graphics.
For instance we can interpret F
as "move forward", L
as "turn left", and R
as "turn right".
However, we can acheive greater complexity if we add two additional commands: [
which "remembers" your previous location and ]
which moves the
cursor/turtle/pen back to the location it was at when the last [
was encountered.
The best way to explore is start from some of the presets so you can get a feel for how the rules interact: