1 A Quick Introduction to L-Systems

An L-System is a string rewriting system, where at each step every non-terminal is rewritten. Each system has one axiom, which is the starting string, a set of rules that describe how to rewrite, and some variables that can control the rewriting and interpreting of the system. For example, the system:

#lang lindenmayer
## axiom ##
A
## rules ##
A -> AB
B -> A
## variables ##
n=3

Starts with the string A, and at each step replaces every A with AB, and every B with an A. After three iterations (which is controlled by the variable n), the string will be ABAAB.