startshape FOREST

rule FOREST {
     SEED {}
     SEED {x -20}
     SEED {x -40}
}

rule SEED {BRANCH {}}
rule SEED {BRANCH {rotate 1}}
rule SEED {BRANCH {rotate -1}}
rule SEED {BRANCH {rotate 2}}
rule SEED {BRANCH {rotate -2}}
rule SEED {FORK {}}

rule BRANCH {LEFTBRANCH {flip 90}}
rule BRANCH {LEFTBRANCH {}}

rule LEFTBRANCH 4 {BLOCK {} LEFTBRANCH {y 0.885 rotate 0.1 size 0.99}}
rule LEFTBRANCH 4 {BLOCK {} LEFTBRANCH {y 0.885 rotate 0.2 size 0.99}}
rule LEFTBRANCH {BLOCK {} LEFTBRANCH {y 0.885 rotate 4 size 0.99}}
rule LEFTBRANCH {BLOCK {} FORK {}}


rule BLOCK {
     SQUARE {rotate 1}
     SQUARE {rotate -1}
     SQUARE {}
}

rule FORK {
     BRANCH { }
     BRANCH {size 0.5 rotate 40}
}
rule FORK {
     BRANCH { }
     BRANCH {size 0.5 rotate -40}
}
rule FORK {
     BRANCH {size 0.5 rotate -20}
     BRANCH { }
}
rule FORK {
     BRANCH {size 0.7 y 0.1 rotate 20}
     BRANCH {size 0.7 y 0.1 rotate -20}
}
