For general information on Lindenmayer systems, please see the related Wikipedia article.
The script that I wrote for js1k contest generates given L-system code on the screen. It supports turning (+
and −
), drawing (F
and G
) and push/pop ([
and ]
) operators.
An L-system code consists of the following lines.
iters:
nangle:
Θstart:
"
S"
:
"
Y"
iters: 4 angle: 90 start: "F" F: "F+F−F−F+F"
iters: 4 angle: 90 start: "F" F: "F+F−F−F+F"
iters: 8 angle: 60 start: "F" F: "G-F-G" G: "F+G+F"