### L SystemSample Scripts I

#### Introduction

The notes for this page were derived from pages 10 to 12 of "The Algorithmic Beauty of Plants" by Przemyslaw Prusinkiewicz and Aristid Lindenmayer. It is very useful when testing the implementation of a L system to have examples of axioms and rules that generate known shapes.

This page consists of 9 example curves. The first seven are similar to the Koch snowflake - a shape proposed by Niels von Koch in 1905. The last two are copies of the Sierpinski gasket, first proposed in 1915, and the Gosper curve (1976). Although the curves by von Kock, Sierpinski and Gosper can be produced by a L system they were originally produced by other techniques.

 Space Filling `"1z1>z11z1"` The shapes in this section are based on the following script.   Only the rule for each shape requires editing.   The axiom itself produces a square. ``` axiom "1z1"` `"11z1z1

This curve is an example of applying two rules to produce a shape. The rules are almost identical in that they each produce three sides of a hexagon, but rule "G" makes its shape "turning" to the right, while rule "H" makes it shape while "turning" to the left.

The parts of the final curve that were produced by rule "G" are colored blue, while those segements produced by rule "H" are colored red.

```  axiom "H"
rule G   "H>zG>zH"
rule H   "G<zH<zG"
rule "*G" "1" # apply this rule only on the last rewrite
rule "*H" "1" # apply this rule only on the last rewrite
angle 60
generations 5```

#### Gosper Space Filling Curves

This curve is an example of a space filling curve. With increasing generations it fills its interior more and more thoroughly. Again it is based on two rules that produce "left turning" and "right turning" curves.

The parts of the final curve that were produced by rule "G" are colored blue, while those segements produced by rule "H" are colored red.

```  axiom "H"
rule "G"   "G>zH>zzH<zG<zzGG<zH>z"
rule "H"   "<zG>zHH>zzH>zG<zzG<zH"
rule "*G" "1" # apply this rule only on the last rewrite
rule "*H" "1" # apply this rule only on the last rewrite
angle 60
generations 5```