##Dyalog APL, (削除) 8 (削除ここまで) 7 bytes
Dyalog APL, (削除) 8 (削除ここまで) 7 bytes
≠⌿⍴∘2⊤⍳
This is a monadic train that expects an index origin of 0 (⎕IO←0). The equivalent non-train function is {≠⌿(⍵⍴2)⊤⍳⍵}.
Explanation:
⍳ List of numbers from 0 to (input-1)
⍴∘2 (input) copies of 2
⊤ Convert all the elements in ⍳ to base 2 to (input) digits
≠⌿ Reduce over the first axis by not-equal
Output is a space-separated list of 0 and 1. Try it here.
##Dyalog APL, (削除) 8 (削除ここまで) 7 bytes
≠⌿⍴∘2⊤⍳
This is a monadic train that expects an index origin of 0 (⎕IO←0). The equivalent non-train function is {≠⌿(⍵⍴2)⊤⍳⍵}.
Explanation:
⍳ List of numbers from 0 to (input-1)
⍴∘2 (input) copies of 2
⊤ Convert all the elements in ⍳ to base 2 to (input) digits
≠⌿ Reduce over the first axis by not-equal
Output is a space-separated list of 0 and 1. Try it here.
Dyalog APL, (削除) 8 (削除ここまで) 7 bytes
≠⌿⍴∘2⊤⍳
This is a monadic train that expects an index origin of 0 (⎕IO←0). The equivalent non-train function is {≠⌿(⍵⍴2)⊤⍳⍵}.
Explanation:
⍳ List of numbers from 0 to (input-1)
⍴∘2 (input) copies of 2
⊤ Convert all the elements in ⍳ to base 2 to (input) digits
≠⌿ Reduce over the first axis by not-equal
Output is a space-separated list of 0 and 1. Try it here.
##Dyalog APL, (削除) 8 (削除ここまで) 7 bytes
≠⌿⍴∘2⊤⍳
Set yourThis is a monadic train that expects an index origin toof 0 before running this(⎕IO←0). Outputs asThe equivalent non-train function is {≠⌿(⍵⍴2)⊤⍳⍵}.
Explanation:
⍳ List of numbers from 0 to (input-1)
⍴∘2 (input) copies of 2
⊤ Convert all the elements in ⍳ to base 2 to (input) digits
≠⌿ Reduce over the first axis by not-equal
Output is a space-separated list of 0 and 1. Try it here.
##Dyalog APL, (削除) 8 (削除ここまで) 7 bytes
≠⌿⍴∘2⊤⍳
Set your index origin to 0 before running this. Outputs as a space-separated list of 0 and 1.
##Dyalog APL, (削除) 8 (削除ここまで) 7 bytes
≠⌿⍴∘2⊤⍳
This is a monadic train that expects an index origin of 0 (⎕IO←0). The equivalent non-train function is {≠⌿(⍵⍴2)⊤⍳⍵}.
Explanation:
⍳ List of numbers from 0 to (input-1)
⍴∘2 (input) copies of 2
⊤ Convert all the elements in ⍳ to base 2 to (input) digits
≠⌿ Reduce over the first axis by not-equal
Output is a space-separated list of 0 and 1. Try it here.
##Dyalog APL, 8(削除) 8 (削除ここまで) 7 bytes
≠⌿⍳⊤⍨⍴∘2≠⌿⍴∘2⊤⍳
Set your index origin to 0 before running this. Outputs as a space-separated list of 0 and 1.
##Dyalog APL, 8 bytes
≠⌿⍳⊤⍨⍴∘2
Set your index origin to 0 before running this. Outputs as a space-separated list of 0 and 1.
##Dyalog APL, (削除) 8 (削除ここまで) 7 bytes
≠⌿⍴∘2⊤⍳
Set your index origin to 0 before running this. Outputs as a space-separated list of 0 and 1.