Giancarlo Bassi <[EMAIL PROTECTED]> 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 



_______________________________________________
Guile-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/guile-user

Reply via email to