L-System Plant in C# .NET
The algorithm works on the principle of gradual evolvement of the basic assignment by the predetermined rules. When correctly combined with the graphical algorithm (more precisely the Turtle) that reads, translates and draws the results, very interesting patterns can be created. The behavior of the program is easily predictable. Here's an example:
Basic variables: A, B Rules: A => A B B => A n(total iterations) = 4 Progress: n=0: A / \ n=1: A B /| \ n=2: A B A /| | |\ n=3: A B A A B /| | |\ |\ \ n=4: A B A A B A B A
Rendering:
Rules directly implemented in the L-System:
- F = step forward and draw
- f = step forward
- [ = save the last state
- ] = return to the last saved state
- + = rotate +x radians
- - = rotate -x radians
Part of the algorithm is a pseudo-random change in length, angle, and automatic color determination based on continuity. There's also an attempt to automatically generate rules and the base string, but that's in its early stage.
This program took the first place in the local Algorithms Competition.
Gallery
Download
By downloading the following file, you agree to the license terms
Downloaded 41x (717.29 kB)
Application includes source codes in language C# .NET