Every number below updates live as you change the system, so this always describes exactly what's on screen.
A Lindenmayer system rewrites a string of symbols in parallel: starting from an axiom, every symbol in the string is replaced at once, every generation, according to a fixed set of production rules — not one symbol at a time, like most formal grammars. Formally, a system is a triple G = (V, ω, P): an alphabet V, an axiom ω, and rules P. Iterating the rules a few times turns a short seed into a long string that a turtle can draw.
F, G — move forward, drawing a line
f, g — move forward without drawing
+ — turn left by the angle θ
− — turn right by the angle θ
[ — push the current position & heading onto a stack
] — pop a position & heading off the stack
anything else — ignored by the turtle (bookkeeping symbols only)
Three well-known extensions to the basic grammar above: context-sensitive systems, where a rule only fires when its symbol has specific neighbors (e.g. "b < a > c → aa" rewrites a only between b and c); stochastic systems, where a symbol has several possible replacements, each chosen by chance every generation; and parametric systems, where symbols carry numeric parameters (e.g. a(x,y)) that rules can read and rewrite. This tool sticks to plain deterministic, context-free rules (a "D0L system").
Grammar & turtle conventions from the Wikipedia L-system article. "Randomize system" is adapted from ehrenjn's L-Systems visualizer (guarantee-at-least-one-F, and blending curated "nice" angles with fully random ones).
Grammar from the Wikipedia L-system article. Random-system generation adapted from ehrenjn's L-Systems visualizer.