Thue-Morse: Difference between revisions
Added Arturo implementation
m (→Excel LAMBDA: Showed progressive iterations) |
Drkameleon (talk | contribs) (Added Arturo implementation) |
||
Line 268:
0110100110010110100101100110100110010110011010010110100110010110
01101001100101101001011001101001100101100110100101101001100101101"</lang>
=={{header|Arturo}}==
<lang rebol>thueMorse: function [maxSteps][
result: new []
val: [0]
count: new 0
while [true][
'result ++ join to [:string] val
inc 'count
if count = maxSteps -> return result
val: val ++ map val 'v -> 1 - v
]
return result
]
loop thueMorse 6 'bits ->
print bits</lang>
{{out}}
<pre>0
01
0110
01101001
0110100110010110
01101001100101101001011001101001</pre>
=={{header|AWK}}==
|