Hm, we're talking about fundamental concepts of the universe here (axioms?), aren't we? At least concerning the three positive unit vectors - the rest are just mirrors through origin. These things don't like to be defined using other concepts.
>From what you state in your problem - what exactly is the question? "All 6 directions" is intuitive enough for me, but how to formulate it logically? Compare to questions like "All 3 directions" or "All 8 directions". I usually struggle when it comes to determining how "elegant" a piece of code is, but 1,0,0 0,1,0 0,0,1 looks elegant enough for me. :) /Stefan On Fri, Jul 15, 2011 at 11:15 PM, Kassen <[email protected]>wrote: > 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. > -- Release me, insect, or I will destroy the Cosmos!
