Lindenmayer


Project maintained by IohannRabeson Hosted on GitHub Pages — Theme by mattgraham

Programming in L-Code

Structure of a L-Code program

The L-Code language is an attempt to provide a language able to describe several Lindenmayer's systems.

An L-Code program look like almost any Lindenmayer's system textual representation. The following example is the Koch curve written in L-Code:

    iteration: 4;
    distance: 10.;
    angle: 90.;
    axiom: --F;
    F -> F+F-F-F+F;
    
This code is very similar to the Koch curve pseudo-code on Wikipedia:
    variables : F
    constants : + −
    start : F
    rules : (F → F+F−F−F+F)
    
And finally the image generated by Lindenmayer:
koch curve

Languages reference

Modules

Variables

Predefined variables

Name Value type Description
axiom Modules Modules from which to begin construction
iteration unsigned integer Iteration count
distance unsigned float The distance that the turtle moves when 'forward' is called
angle float The angle that the turtle rotates when '+' or '-' is called

Rewrite rules

Aliases

Deterministic L-Systems

Stochastic L-Systems