Hilbert curve

Hilbert curve

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
lsystem HilbertCurve {
 
set symbols axiom = L;
set iterations = 6;
 
interpret F as DrawForward(8);
interpret + as TurnLeft(90);
interpret - as TurnLeft(-90);
 
rewrite L to + R F - L F L - F R +;
rewrite R to - L F + R F R + F L -;
}
 
process all with SvgRenderer;