[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Guile code for L-system
From: |
Neil Jerram |
Subject: |
Re: Guile code for L-system |
Date: |
Wed, 24 May 2006 19:28:25 +0100 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) |
Giancarlo Bassi <address@hidden> writes:
> I want to write in Guile the code implementing these following
> rewriting rules, which are taken from L-system rewriting (from
> Lindenmayer's
> "Algorithmic beauty of plants")
>
> Axiom a
> a -> b
> b -> ab
>
> So, it should be create these lists
>
> `(a) `(b) `(a b) `(b a b) `(a b b a b) `(b a b a b b a b)
(define (iterate l)
(apply append
(map (lambda (x)
(case x
((a) '(b))
((b) '(a b))))
l)))
>
> You may notice that the lists' length are Fibonacci's number.
>
> This drill should introduce my final purpose to write the
> Guile code for the Hilbert-Peano's curve, which in L-system
> looks as:
>
> Axiom x
> x -> - f y + x f x + f y -
> y -> + x f - y f y - f x +
>
> where f means a translation and + - are rotations.
I'm afraid you've lost me here.
Neil