diff options
Diffstat (limited to 'examples/l-system-example.lisp')
-rw-r--r-- | examples/l-system-example.lisp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/examples/l-system-example.lisp b/examples/l-system-example.lisp index 37d5cc3..deac189 100644 --- a/examples/l-system-example.lisp +++ b/examples/l-system-example.lisp @@ -3,26 +3,28 @@ ;;Lindenmayer's original L-system ;;Example 1: Algae (-> a () - (a) (b)) + '((a) (b))) (-> b () - (a)) + '((a))) (l-system #'parametric-grammar '((a)) 3) ;;;Parametric grammars (-> f () - (f 1) - (j 1) - (f 1)) + '((f 1) + (j 1) + (f 1))) (-> j (x) - (j (* 3 x))) + (if (oddp x) + `((j ,(1+ (* 3 x)))) + `((j ,(/ x 2))))) (l-system #'parametric-grammar '((f 1.0)) 3) ;;;Context sensitive grammars (-> (f j f) (x) - (j (* 2 x))) + `((j ,(* 2 x)))) (l-system #'context-sensitive-grammar '((f 1.0)) 3) |