Broken Sierpinski

Broken Sierpinski

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
lsystem BrokenSierpinski {
 
set symbols axiom = F + F + F;
set iterations = 6;
set continuousColoring = true;
 
interpret F f as MoveForward(2 ^ -currentIteration * 1024);
interpret + as TurnLeft(120);
interpret < as StartPolygon(0, 0);
interpret . as RecordPolygonVertex;
interpret > as EndPolygon;
 
rewrite F to < . F . + F . > + f + f F;
rewrite < to nothing;
rewrite . to nothing;
rewrite > to nothing;
}
 
process all with SvgRenderer;