Thue-Morse: Difference between revisions

Add Draco
(Add Draco)
Line 790:
=={{header|Delphi}}==
See [https://rosettacode.org/wiki/Thue-Morse#Pascal Pascal].
 
=={{header|Draco}}==
<lang draco>/* Find the N'th digit in the Thue-Morse sequence */
proc nonrec tm(word n) byte:
word n2;
n2 := n;
while n2 ~= 0 do
n2 := n2 >> 1;
n := n >< n2
od;
n & 1
corp
 
/* Print the first 64 digits */
proc nonrec main() void:
byte i;
for i from 0 upto 63 do
write(tm(i):1)
od
corp</lang>
{{out}}
<pre>0110100110010110100101100110100110010110011010010110100110010110</pre>
 
=={{header|Elena}}==
2,114

edits