Lsystems in pf

code - September 5th, 2006 - Marloes de Valk - No Comments

Recently I read some things about Lsystems and started building one in Packet Forth. L-systems are a mathematical formalism proposed by Aristid Lindenmayer in 1968 as a foundation for an axiomatic theory of biological development. The system I wrote works like any other Lsystem. It takes a seed and a rule on how to grow from that seed. It is a string rewriting system based on cell divisions in multicellular organisms such as plants. For instance: you start with a seed : A. The rule you use for rewriting is A -> ABA. You can now apply the rule to the seed to create a new string: ABA, and reaply the rule: ABABABA, and so on. Each item in the string is used as directions for a turtle, who visualizes the string. My system produces strings of numbers 0 to 6, interpreted by the turtle as left, right, forward, backward, stop, push and pop. The push and pop make it possible to create branches.


The code can be found on:

Leave a Reply