[Fluxus] a puzzle

Kassen signal.automatique at gmail.com
Fri Jul 15 14:15:26 PDT 2011


Dear list,

I've had a sort of "toy question" in the back of my mind for a while now.

Say we'd like to livecode a shape that extends in all 6 directions (up,
down, left, right, forward, backward) in some way. One way to go about this
would be to write a list of unit-length vectors in those directions.
However, writing that literally is not very elegant. Nicer would be to
generate it. I tried and got this far;

(build-list
    6
    (λ (x) (build-vector
        3
        (λ (y) (if (eq? (quotient x 2) y)
            (if (even? x)
                1
                -1)
            0)))))

Evidently it works, it looks very "scheme-ish" and so on; it's as small as I
can get it.

However, disappointingly, it is also longer to type than its output, more or
less defeating the purpose. It also doesn't really express the question
itself, it seems more of a thing that heads straight for what we already
know is the answer.

Would anyone else like to try too?

Yours,
Kas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pawfal.org/pipermail/fluxus-pawfal.org/attachments/20110715/ced0c803/attachment-0001.htm>


More information about the Fluxus mailing list