Plant

Plant

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
lsystem Plant4 {
 
set symbols axiom = X;
set initialAngle = 90;
set iterations = 7;
 
interpret F(age) as DrawForward(2^age * 1.2, age * 0.6);
interpret + as TurnLeft(20);
interpret - as TurnLeft(-20);
interpret [ as StartBranch;
interpret ] as EndBranch;
 
rewrite X to F(1) [ + X ] F(1) [ - X ] + X;
rewrite F(x) to F(x+1);
}
 
process all with SvgRenderer;