Draw a Flowsnake Fractal
Draw the Gosper flowsnake from its two-symbol L-system at 60 degrees, with depth capped so the tab stays responsive.
The Gosper curve, drawn from its rewrite
Two symbols both draw a stroke. At each step A expands to A-B--B+A++AA+B- and B expands to +A-BB--B-A++A+B, where plus and minus are turns of 60 degrees. Because both symbols draw, the stroke count multiplies by seven per step, and the 60-degree turns keep the path on a hexagonal lattice. That lattice is why the outline looks like a snowflake rather than a dragon.
The page expands the string first and then walks it with a simple turtle, so the drawing is exactly the rewrite and nothing is approximated. Depth is capped at five, where the string already holds 16,807 strokes. One more step is 117,649 strokes, built in a single pass, which is a visible stall rather than a better picture.
The starting symbol is fixed, so the same depth always produces the same curve. Nothing is random and nothing leaves the tab.
Draw a Gosper flowsnake from a two-symbol rewrite on a hexagonal lattice, at a depth you set.
Two symbols draw and the turns are 60°, which is what makes the hexagonal lattice; nothing is random, and nothing is uploaded.
How to use it
Set the depth and press Draw or Animate; Stop ends the animation. The rewrite string is rebuilt on every redraw, which is why the status line reports the stroke count for the depth you chose.
The rule
The seed symbol is A, and each symbol expands into seven. A turns left 60° and B turns right 60°, so the path never leaves the hexagonal lattice and the boundary stays self-similar at every level.
Where it stops
Depth is capped at 5, where the rewrite is 16,807 strokes and the string is rebuilt per redraw. There is no seed, no colour control and no image export.
What to Expect
Best for
- seeing a space-filling curve on a hexagonal grid
- comparing recursion depths on one rule
What this tool keeps
- The rewrite and the drawing run in this tab; the page works offline and stores no image.
Frequently asked questions
What is a flowsnake?
A space-filling curve built on a hexagonal lattice, produced here by a two-symbol rewrite with 60° turns. The seed symbol is A and every symbol becomes seven.
Why stop at depth 5?
Because the rewrite is rebuilt on each redraw and depth 5 is already 16,807 strokes. Deeper levels add strokes the canvas cannot separate.
Is there any randomness?
No. The rewrite is fixed, so the same depth always produces the same curve, and the page keeps no state between redraws.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.