#1 What Are L-Systems and How Do They Work?


L systems are a recursive algorithmic system created by botanist Aristid Lindenmayer around 1968 while studying plant growth. L-Systems are a type of text/string manipulation algorithm and the basic idea behind this system is as follows:

  • Each L system has an “alphabet” which is the characters that will be used in the system

  • Each L system has an “axiom” which is the original starting string for our algorithm (growth stage 0)

  • Each L system has a “rule set” which determines how each character within the string will be manipulated each generation

The easiest example for this would be to use a very simple L system using:

  • Alphabet: A and B
  • Axiom: A
  • Ruleset: A -> AB and B -> A

We always start with the axiom so generation 0 will be the genome “A”.

The second generation will use the ruleset we defined above. The ruleset means “A” gets turned into the string “AB” and “B” gets turned into the string “A”. The algorithm then parses through the string and replaces any “A” it sees with the string “AB” and any “B” it sees with the string “A”.

Therefore generation 1 will be the string “AB”

Using the ruleset again for generation 2 will result in the string “ABA

You can keep doing this over and over again to get an exponentially growing string of characters:

  • gen0: A
  • gen1: AB
  • gen2: ABA
  • gen3: ABAAB
  • gen4: ABAABABA
  • gen5: ABAABABAABAAB

Leave a comment

Log in with itch.io to leave a comment.