Fibonacci word/fractal: Difference between revisions

m
J: clearer description
(→‎{{header|Haskell}}: added solution)
m (J: clearer description)
Line 879:
Instead, I'll just describe the algorithm:
 
This draws a discrete parametric curve. Right turn is 0j_1, left turn is 0j1 (negative and positive square roots of negative 1), straight ahead is 1. So: build a list of alternating 0j_1 and 0j1 and raise them to the first power for the 0s in the fibonacci word list and raise them to the 0th power for the 1s in that list. Then compute the running product,sum shift aof 0 ontofollowed the front ofby the list ofrunning products andof computethat the running sumlist. (Of course, this would translate to a rather simple loop, also, once you see the pattern.)
 
=={{header|Java}}==
6,962

edits