X-border

X-border

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
lsystem XBorder {
 
set iterations = 3;
set symbols axiom =
X Y X Y X Y X +
X Y X Y X Y X +
X Y X Y X Y X +
X Y X Y X Y X;
 
interpret F as DrawForward(5);
interpret + as TurnLeft(90);
interpret - as TurnLeft(-90);
 
rewrite F to nothing;
rewrite X to F X + F X + F X F Y - F Y -;
rewrite Y to + F X + F X F Y - F Y - F Y;
}
 
process all with SvgRenderer;