5 of 5
added 92 characters in body
Andreas Louv
  • 1.7k
  • 13
  • 25

Perl, 39 33 bytes

/$/,say map$`==$_|0,@%for@%=1..<>

Thanks to Ton Hospel for saving 6 bytes

Running with the -E perlrun:

$ echo 3 | perl -E'@%=1..<>;$a=$_,say map{$a==$_|0}@%for@%'
100
010
001
Andreas Louv
  • 1.7k
  • 13
  • 25