Jump to content

Thue-Morse: Difference between revisions

Added 11l
(→‎{{header|Python}}: Add pair-wise concatenation)
(Added 11l)
Line 10:
*   Task: [[Fairshare between two and more]]
<br><br>
 
=={{header|11l}}==
{{trans|Python: By counting set ones in binary representation}}
 
<lang 11l>F thue_morse_digits(digits)
R (0 .< digits).map(n -> bin(n).count(‘1’) % 2)
 
print(thue_morse_digits(20))</lang>
 
{{out}}
<pre>
[0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1]
</pre>
 
=={{header|8080 Assembly}}==
1,481

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.