Type an axiom, list rewrite rules, then set the turn angle and depth. Every symbol expands in parallel on each pass, and the turtle walks the finished string once. The drawing scales itself to fit the frame.
One extra iteration often multiplies symbol count far more than newcomers expect. If the page stutters, drop depth first, then shorten rules.
Lindenmayer systems rewrite every symbol in the current string at once. Two short rules plus six iterations routinely cross tens of thousands of characters. The visualizer still draws at that size, though frame time climbs with it.
We cap depth at eight so a stray keystroke does not freeze the tab. For print work you would still rebuild the figure as vector output somewhere else. The goal here is fast feedback while you learn how axiom choice steers the silhouette.
Any other single character (for example X or Y) is a structural placeholder you rewrite until only motion symbols remain, or until you stop iterating.
String length counts every character after expansion, placeholders included. Segments drawn counts only F and G, so it tells you how many lines the turtle actually inked. Depth mirrors the iteration control.
The gap between the first two numbers is the useful signal. A plant grammar at depth 5 might report 12,000 characters and 4,000 segments, which means two thirds of the work went into bookkeeping symbols. When segments sit near zero but string length is large, your rules never produced a motion symbol and the frame stays blank.
You type an axiom, list productions with = or an ASCII arrow, then pick iterations. The engine expands left to right, substituting each head symbol with its body or leaving it unchanged when no rule exists. After expansion the turtle walks the final string once.
Auto-fit measures every vertex the turtle visits, then scales and centers the polyline inside the frame. Shrinking step length does not shrink the overall shape forever. It changes local detail density while bounds tracking keeps the whole figure visible.
| Tile | Axiom | Angle | Notes |
|---|---|---|---|
| Koch | F | 60° | Three-fold snowflake spine. |
| Sierpinski | F-G-G | 120° | Two symbols, two productions. |
| Plant | X | 25° | Heavy brackets, organic feel. |
| Tree | F | 25.7° | Symmetric branching. |
| Fern | X | 25° | Same rules as plant, deeper run and shorter step. |
| Dragon | FX | 90° | Uses helper symbols X and Y. |
Every opening bracket freezes the turtle where it stands. The interpreter pushes x, y, heading. A closing bracket teleports back without drawing a connecting segment. One stem forks, draws a twig, returns, draws another twig.
If your plant looks like a scribble, count brackets. An unbalanced line usually means a missing closer or an extra opener on one production. The turtle never guesses intent. It executes the expanded string in order, and an unmatched closer is simply skipped.
X=XY and Y=YX expands forever without a single F, so nothing draws.FF=F+F never fires.If you want grammar editing without the scaling stage, open the L-System Fractal Generator. Prefer classic snowflake geometry with dedicated sliders? Use the Koch Snowflake Generator. Branching silhouettes without writing productions first appear in the Fractal Tree Generator.
There is no stochastic rule picker, no 3D turtle, no image export. Stochastic L-systems need a random seed per run and a weighted rule table. A 3D turtle needs a second rotation axis and a pitch command set. You also will not find file upload: the grammar lives in the textarea only.
Processing stays in your tab. Nothing reaches a server, and clearing the canvas is enough if someone else uses the machine. The expanded string panel is optional, useful mainly for students tracing how fast symbol count climbs.
Short answers tied to this turtle implementation.
Auto-fit recomputes bounds from every drawn vertex, so rotating the heading rotates the whole polyline rather than cropping it. A truly empty frame points at the grammar instead: if the rules never emit F or G, the segment counter reads zero and there is nothing to scale. Add a motion symbol or raise iterations so placeholders unfold.
Leading and trailing spaces on each line are trimmed. Spaces inside the replacement string count as literal characters, which usually breaks single-letter turtle commands. Keep productions tight unless you intentionally embed blanks.
Dragon-style axioms mix two non-drawing symbols before the string fills with turns and steps. Length grows faster than intuitive estimates, so the turtle executes more commands per depth step. Drop depth or raise step length before blaming hardware.
No. Rules are stored in a plain map keyed by the head character, so a second line for the same symbol overwrites the first. Deterministic output is the trade: you get the same picture every draw, at the cost of the randomness that stochastic L-systems rely on.
No server round trip runs here. The script reads your fields, expands the string in memory, paints the canvas, and stops. Refreshing the page clears everything unless your browser restores form fields.