Also known as Lindenmayersystem.
It is a recursive system built on simple replacement rules.
L-System (Wikipedia)
Rules, like F+[FF-X], are handled procedurally and not recursively.
We go through all of the characters in the current state string and apply the current rules.
If the state is FF and the rule is F+F then state+1 would be F+FF+F.
Once we have gone through all of the rules for all of the states for the given number of iterations we can go on to draw the final state onto the image.
As most classic implementation, we also use a "turtle" to draw with. It's just a point in space.
Each rule like F or X draws a line or fills an circle with a color.
Rules like - and + rotates the turtle direction for the drawing.
The program outputs *.ppm images, and they are not viewable online but you should be able to view them on whatever OS you have.
The run.sh file will build and run the program.
You have to give your basic rules as a string.
./run.sh "F+[FF-]X++[F+FFF]FFFF-FF"
And all of the output is placed into output/*.ppm
More screenshots of the outputs can be found in the img/ directory.
















Here we can see the basis of the basic L-System rules implemented actually behave when nothing new is happening.

