Draw a Moore Fractal
Draw the Moore curve: the closed-loop space-filling curve whose two ends meet, from its two-symbol L-system.
The closed-loop Hilbert
The Moore curve is the space-filling curve that closes on itself: its first and last points are neighbours, so the path reads as one continuous loop through the square. The page uses the two-symbol rewrite LFL+F+LFL: L and R expand into more of the loop, only F draws a stroke, and every turn is a right angle. The axiom begins and ends on the same edge, which is what closes the loop.
The stroke count grows by about a factor of four per step, so the depth is capped at four: just over a thousand strokes, enough to read as a closed loop at this canvas size. At five the rewrite string and the per-frame build cost more than the extra detail can show.
L and R are the only placeholders and every turn is a right angle, so the path is fully determined by the depth. Reloading reproduces the same loop, and nothing is sent anywhere.
Draw a Moore curve: the closed variant of the Hilbert curve, whose axiom starts and ends on the same edge so the path comes back to where it began.
The draw order is fixed by the rewrite, so the same depth always produces the same closed path.
How to use it
Set the depth, then press Draw or Animate. Stop ends the animation, and the status line names the stroke count at that depth.
The rule
The seed axiom begins and ends on the same edge, and each symbol expands into a longer string of strokes and turns. That closed seed is what makes the curve a loop rather than an open path.
Where it stops
Depth is capped at 4, because the stroke count multiplies by about four per step and a deeper figure would be thousands of strokes this canvas cannot resolve. There is no export and no seed.
What to Expect
Best for
- seeing a space-filling curve as a closed loop
- comparing the Moore and Hilbert constructions
What this tool keeps
- The rewrite and the drawing happen in this tab; nothing is uploaded and no image is kept.
Frequently asked questions
What makes it a Moore curve?
The seed axiom starts and ends on the same edge, so the finished path is closed. Each symbol then expands into more strokes and turns at every level.
Why is the cap only 4?
Because the stroke count multiplies by about four per step. Depth 5 would be around four thousand strokes, which is more detail than the canvas separates.
Is anything random here?
No. The rewrite fixes the draw order, so a given depth always produces the same path.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.