Jump to content

Thue-Morse: Difference between revisions

(Added solution for Action!)
Line 1,359:
<pre>[0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1]</pre>
 
=={{header|jq}}==
'''Adapted from [[#Wren]]'''
{{works with|jq}}
'''Works with gojq, the Go implementation of jq'''
 
<lang jq>def thueMorse:
reduce range(0; .) as $_ (
{sb0: "0", sb1: "1" };
{sb0: (.sb0 + .sb1), sb1: (.sb1 + .sb0)} )
| .sb0 ;
range(0;7)
| "\(.) : \(thueMorse)"</lang>
{{out}}
As for [[#wren]].
=={{header|Julia}}==
{{works with|Julia|0.6}}
2,484

edits

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