[Question]
  [
You have a 3x3 grid. Each cell can be colored black or white. Display all 512 of these colorings. Fewest bytes wins.
You can display the grids in any formation as long as they are visually separated and the spacing looks regular. You may use ASCII art or images. Any two distinct visible symbols or colors can be used for black and white. Any whitespace is fine as long as the result is visually correct.
**Example output:**
```
...
...
...
...
...
..X
...
...
.X.
...
...
.XX
...
...
X..
...
...
X.X
...
...
XX.
...
...
XXX
...
..X
...
...
..X
..X
...
..X
.X.
...
..X
.XX
...
..X
X..
...
..X
X.X
...
..X
XX.
...
..X
XXX
...
.X.
...
...
.X.
..X
...
.X.
.X.
...
.X.
.XX
...
.X.
X..
...
.X.
X.X
...
.X.
XX.
...
.X.
XXX
...
.XX
...
...
.XX
..X
...
.XX
.X.
...
.XX
.XX
...
.XX
X..
...
.XX
X.X
...
.XX
XX.
...
.XX
XXX
...
X..
...
...
X..
..X
...
X..
.X.
...
X..
.XX
...
X..
X..
...
X..
X.X
...
X..
XX.
...
X..
XXX
...
X.X
...
...
X.X
..X
...
X.X
.X.
...
X.X
.XX
...
X.X
X..
...
X.X
X.X
...
X.X
XX.
...
X.X
XXX
...
XX.
...
...
XX.
..X
...
XX.
.X.
...
XX.
.XX
...
XX.
X..
...
XX.
X.X
...
XX.
XX.
...
XX.
XXX
...
XXX
...
...
XXX
..X
...
XXX
.X.
...
XXX
.XX
...
XXX
X..
...
XXX
X.X
...
XXX
XX.
...
XXX
XXX
..X
...
...
..X
...
..X
..X
...
.X.
..X
...
.XX
..X
...
X..
..X
...
X.X
..X
...
XX.
..X
...
XXX
..X
..X
...
..X
..X
..X
..X
..X
.X.
..X
..X
.XX
..X
..X
X..
..X
..X
X.X
..X
..X
XX.
..X
..X
XXX
..X
.X.
...
..X
.X.
..X
..X
.X.
.X.
..X
.X.
.XX
..X
.X.
X..
..X
.X.
X.X
..X
.X.
XX.
..X
.X.
XXX
..X
.XX
...
..X
.XX
..X
..X
.XX
.X.
..X
.XX
.XX
..X
.XX
X..
..X
.XX
X.X
..X
.XX
XX.
..X
.XX
XXX
..X
X..
...
..X
X..
..X
..X
X..
.X.
..X
X..
.XX
..X
X..
X..
..X
X..
X.X
..X
X..
XX.
..X
X..
XXX
..X
X.X
...
..X
X.X
..X
..X
X.X
.X.
..X
X.X
.XX
..X
X.X
X..
..X
X.X
X.X
..X
X.X
XX.
..X
X.X
XXX
..X
XX.
...
..X
XX.
..X
..X
XX.
.X.
..X
XX.
.XX
..X
XX.
X..
..X
XX.
X.X
..X
XX.
XX.
..X
XX.
XXX
..X
XXX
...
..X
XXX
..X
..X
XXX
.X.
..X
XXX
.XX
..X
XXX
X..
..X
XXX
X.X
..X
XXX
XX.
..X
XXX
XXX
.X.
...
...
.X.
...
..X
.X.
...
.X.
.X.
...
.XX
.X.
...
X..
.X.
...
X.X
.X.
...
XX.
.X.
...
XXX
.X.
..X
...
.X.
..X
..X
.X.
..X
.X.
.X.
..X
.XX
.X.
..X
X..
.X.
..X
X.X
.X.
..X
XX.
.X.
..X
XXX
.X.
.X.
...
.X.
.X.
..X
.X.
.X.
.X.
.X.
.X.
.XX
.X.
.X.
X..
.X.
.X.
X.X
.X.
.X.
XX.
.X.
.X.
XXX
.X.
.XX
...
.X.
.XX
..X
.X.
.XX
.X.
.X.
.XX
.XX
.X.
.XX
X..
.X.
.XX
X.X
.X.
.XX
XX.
.X.
.XX
XXX
.X.
X..
...
.X.
X..
..X
.X.
X..
.X.
.X.
X..
.XX
.X.
X..
X..
.X.
X..
X.X
.X.
X..
XX.
.X.
X..
XXX
.X.
X.X
...
.X.
X.X
..X
.X.
X.X
.X.
.X.
X.X
.XX
.X.
X.X
X..
.X.
X.X
X.X
.X.
X.X
XX.
.X.
X.X
XXX
.X.
XX.
...
.X.
XX.
..X
.X.
XX.
.X.
.X.
XX.
.XX
.X.
XX.
X..
.X.
XX.
X.X
.X.
XX.
XX.
.X.
XX.
XXX
.X.
XXX
...
.X.
XXX
..X
.X.
XXX
.X.
.X.
XXX
.XX
.X.
XXX
X..
.X.
XXX
X.X
.X.
XXX
XX.
.X.
XXX
XXX
.XX
...
...
.XX
...
..X
.XX
...
.X.
.XX
...
.XX
.XX
...
X..
.XX
...
X.X
.XX
...
XX.
.XX
...
XXX
.XX
..X
...
.XX
..X
..X
.XX
..X
.X.
.XX
..X
.XX
.XX
..X
X..
.XX
..X
X.X
.XX
..X
XX.
.XX
..X
XXX
.XX
.X.
...
.XX
.X.
..X
.XX
.X.
.X.
.XX
.X.
.XX
.XX
.X.
X..
.XX
.X.
X.X
.XX
.X.
XX.
.XX
.X.
XXX
.XX
.XX
...
.XX
.XX
..X
.XX
.XX
.X.
.XX
.XX
.XX
.XX
.XX
X..
.XX
.XX
X.X
.XX
.XX
XX.
.XX
.XX
XXX
.XX
X..
...
.XX
X..
..X
.XX
X..
.X.
.XX
X..
.XX
.XX
X..
X..
.XX
X..
X.X
.XX
X..
XX.
.XX
X..
XXX
.XX
X.X
...
.XX
X.X
..X
.XX
X.X
.X.
.XX
X.X
.XX
.XX
X.X
X..
.XX
X.X
X.X
.XX
X.X
XX.
.XX
X.X
XXX
.XX
XX.
...
.XX
XX.
..X
.XX
XX.
.X.
.XX
XX.
.XX
.XX
XX.
X..
.XX
XX.
X.X
.XX
XX.
XX.
.XX
XX.
XXX
.XX
XXX
...
.XX
XXX
..X
.XX
XXX
.X.
.XX
XXX
.XX
.XX
XXX
X..
.XX
XXX
X.X
.XX
XXX
XX.
.XX
XXX
XXX
X..
...
...
X..
...
..X
X..
...
.X.
X..
...
.XX
X..
...
X..
X..
...
X.X
X..
...
XX.
X..
...
XXX
X..
..X
...
X..
..X
..X
X..
..X
.X.
X..
..X
.XX
X..
..X
X..
X..
..X
X.X
X..
..X
XX.
X..
..X
XXX
X..
.X.
...
X..
.X.
..X
X..
.X.
.X.
X..
.X.
.XX
X..
.X.
X..
X..
.X.
X.X
X..
.X.
XX.
X..
.X.
XXX
X..
.XX
...
X..
.XX
..X
X..
.XX
.X.
X..
.XX
.XX
X..
.XX
X..
X..
.XX
X.X
X..
.XX
XX.
X..
.XX
XXX
X..
X..
...
X..
X..
..X
X..
X..
.X.
X..
X..
.XX
X..
X..
X..
X..
X..
X.X
X..
X..
XX.
X..
X..
XXX
X..
X.X
...
X..
X.X
..X
X..
X.X
.X.
X..
X.X
.XX
X..
X.X
X..
X..
X.X
X.X
X..
X.X
XX.
X..
X.X
XXX
X..
XX.
...
X..
XX.
..X
X..
XX.
.X.
X..
XX.
.XX
X..
XX.
X..
X..
XX.
X.X
X..
XX.
XX.
X..
XX.
XXX
X..
XXX
...
X..
XXX
..X
X..
XXX
.X.
X..
XXX
.XX
X..
XXX
X..
X..
XXX
X.X
X..
XXX
XX.
X..
XXX
XXX
X.X
...
...
X.X
...
..X
X.X
...
.X.
X.X
...
.XX
X.X
...
X..
X.X
...
X.X
X.X
...
XX.
X.X
...
XXX
X.X
..X
...
X.X
..X
..X
X.X
..X
.X.
X.X
..X
.XX
X.X
..X
X..
X.X
..X
X.X
X.X
..X
XX.
X.X
..X
XXX
X.X
.X.
...
X.X
.X.
..X
X.X
.X.
.X.
X.X
.X.
.XX
X.X
.X.
X..
X.X
.X.
X.X
X.X
.X.
XX.
X.X
.X.
XXX
X.X
.XX
...
X.X
.XX
..X
X.X
.XX
.X.
X.X
.XX
.XX
X.X
.XX
X..
X.X
.XX
X.X
X.X
.XX
XX.
X.X
.XX
XXX
X.X
X..
...
X.X
X..
..X
X.X
X..
.X.
X.X
X..
.XX
X.X
X..
X..
X.X
X..
X.X
X.X
X..
XX.
X.X
X..
XXX
X.X
X.X
...
X.X
X.X
..X
X.X
X.X
.X.
X.X
X.X
.XX
X.X
X.X
X..
X.X
X.X
X.X
X.X
X.X
XX.
X.X
X.X
XXX
X.X
XX.
...
X.X
XX.
..X
X.X
XX.
.X.
X.X
XX.
.XX
X.X
XX.
X..
X.X
XX.
X.X
X.X
XX.
XX.
X.X
XX.
XXX
X.X
XXX
...
X.X
XXX
..X
X.X
XXX
.X.
X.X
XXX
.XX
X.X
XXX
X..
X.X
XXX
X.X
X.X
XXX
XX.
X.X
XXX
XXX
XX.
...
...
XX.
...
..X
XX.
...
.X.
XX.
...
.XX
XX.
...
X..
XX.
...
X.X
XX.
...
XX.
XX.
...
XXX
XX.
..X
...
XX.
..X
..X
XX.
..X
.X.
XX.
..X
.XX
XX.
..X
X..
XX.
..X
X.X
XX.
..X
XX.
XX.
..X
XXX
XX.
.X.
...
XX.
.X.
..X
XX.
.X.
.X.
XX.
.X.
.XX
XX.
.X.
X..
XX.
.X.
X.X
XX.
.X.
XX.
XX.
.X.
XXX
XX.
.XX
...
XX.
.XX
..X
XX.
.XX
.X.
XX.
.XX
.XX
XX.
.XX
X..
XX.
.XX
X.X
XX.
.XX
XX.
XX.
.XX
XXX
XX.
X..
...
XX.
X..
..X
XX.
X..
.X.
XX.
X..
.XX
XX.
X..
X..
XX.
X..
X.X
XX.
X..
XX.
XX.
X..
XXX
XX.
X.X
...
XX.
X.X
..X
XX.
X.X
.X.
XX.
X.X
.XX
XX.
X.X
X..
XX.
X.X
X.X
XX.
X.X
XX.
XX.
X.X
XXX
XX.
XX.
...
XX.
XX.
..X
XX.
XX.
.X.
XX.
XX.
.XX
XX.
XX.
X..
XX.
XX.
X.X
XX.
XX.
XX.
XX.
XX.
XXX
XX.
XXX
...
XX.
XXX
..X
XX.
XXX
.X.
XX.
XXX
.XX
XX.
XXX
X..
XX.
XXX
X.X
XX.
XXX
XX.
XX.
XXX
XXX
XXX
...
...
XXX
...
..X
XXX
...
.X.
XXX
...
.XX
XXX
...
X..
XXX
...
X.X
XXX
...
XX.
XXX
...
XXX
XXX
..X
...
XXX
..X
..X
XXX
..X
.X.
XXX
..X
.XX
XXX
..X
X..
XXX
..X
X.X
XXX
..X
XX.
XXX
..X
XXX
XXX
.X.
...
XXX
.X.
..X
XXX
.X.
.X.
XXX
.X.
.XX
XXX
.X.
X..
XXX
.X.
X.X
XXX
.X.
XX.
XXX
.X.
XXX
XXX
.XX
...
XXX
.XX
..X
XXX
.XX
.X.
XXX
.XX
.XX
XXX
.XX
X..
XXX
.XX
X.X
XXX
.XX
XX.
XXX
.XX
XXX
XXX
X..
...
XXX
X..
..X
XXX
X..
.X.
XXX
X..
.XX
XXX
X..
X..
XXX
X..
X.X
XXX
X..
XX.
XXX
X..
XXX
XXX
X.X
...
XXX
X.X
..X
XXX
X.X
.X.
XXX
X.X
.XX
XXX
X.X
X..
XXX
X.X
X.X
XXX
X.X
XX.
XXX
X.X
XXX
XXX
XX.
...
XXX
XX.
..X
XXX
XX.
.X.
XXX
XX.
.XX
XXX
XX.
X..
XXX
XX.
X.X
XXX
XX.
XX.
XXX
XX.
XXX
XXX
XXX
...
XXX
XXX
..X
XXX
XXX
.X.
XXX
XXX
.XX
XXX
XXX
X..
XXX
XXX
X.X
XXX
XXX
XX.
XXX
XXX
XXX
```
  
[Answer]
# Mathematica, 25 bytes
```
Image/@{0,1}~Tuples~{3,3}
```
Gives an array with all the grids as images, which is also directly displayed on screen:
![enter image description here](https://i.stack.imgur.com/rwOOS.png)
(Cropped so as not to blow up the post unnecessarily.)
[Answer]
# K, 11 bytes
```
(3 3#)'!9#2
```
Output example:
```
((0 0 0
  0 0 0
  0 0 0)
 (0 0 0
  0 0 0
  0 0 1)
 (0 0 0
  0 0 0
  0 1 0)
 (0 0 0
  0 0 0
  0 1 1)
…
```
This is K's native prettyprinted representation of a list of matrices, which I think is sufficient for the problem spec. Each matrix is delimited by an enclosing set of parentheses.
And a quick sanity check to demonstrate that 512 matrices are constructed:
```
  #(3 3#)'!9#2
512
```
Very straightforward. Most of the work is in the `!`. First we generate a 9-long vector of 2s using "take" (`9#2`). Then, we make use of the "odometer" monadic form of `!`- a few examples illustrate its behavior:
```
  !2 2
(0 0
 0 1
 1 0
 1 1)
  !2 3
(0 0
 0 1
 0 2
 1 0
 1 1
 1 2)
  !2 2 2
(0 0 0
 0 0 1
 0 1 0
 0 1 1
 1 0 0
 1 0 1
 1 1 0
 1 1 1)
```
Then simply do a 3x3 reshape (`(3 3#)`) of each (`'`) of the 9-length 0/1 vectors.
[Answer]
# JavaScript, 77 ~~80~~
Revised after the revision of the OP. Now we have a question, so here is an answer.
Run the snippet in any browser to test.
```
// Test: redefine console to have output inside the snippet
console = { log: function(x) { O.textContent+=x+'\n\n';} }
// Solution: 77 chars (note, distinct outputs to console are automatically separed)
  
for(i=511;++i<1024;)console.log(i.toString(2).slice(1).match(/.../g).join`
`)
```
```
<pre id=O></pre>
```
Old post: graphic display in a browser, with javascript and canvas. ~300 byte of code (can be made shorter).
Run the snippet below.
```
d=8, // Min block size
C.width=d*64,C.height=d*128,
T=C.getContext('2d')
for(i=0;i<512;i++)
{
  bx=4*(i/32|0)
  by=4*(i%32)
  for(b=1,j=0;j<9;j++,b+=b)    
  {
    if(b&i) 
      x=j/3|0, y=j%3, T.fillRect((bx+x)*d,(by+y)*d,d,d);
  }
  T.strokeRect(bx*d,by*d,d*3,d*3);
}
```
```
<canvas id=C></canvas>
```
[Answer]
# Matlab, 33
```
reshape(dec2bin(0:511,9)',3,3,[])
```
Was kind of fiddly to get the dimensions correct, but I am very happy with the result!
[Answer]
## POWERSHELL - 65
```
0..511|%{[convert]::ToString($_,2).padleft(9,'0')-split"(.{3})"}
```
result
```
000
000
000
000
000
001
000
000
010
000
000
011
```
confirmation
```
(0..511|%{[convert]::ToString($_,2).padleft(9,'0')-split"(.{3})"} | measure -Line).lines/3
512
```
edit inspired by the mathematica answer's display of results-617
```
Add-Type -AssemblyName System.Drawing
$a=new-object System.Drawing.Bitmap 992,496
$g=[Drawing.Graphics]::FromImage($a)
$b=@{};$y=@{};$i=$c=$d=$z=$k=$l=$m=0;
0..511|%{$y[$d++]=[convert]::ToString($_,2).padleft(9,'0')}
while($m-lt480){while($l-lt496){for($z=($m+0);$z-lt($m+32);$z++){
      $y[$z].tochararray()|%{if($_-eq"0"){$b[$i++]=[Drawing.Brushes]::Black}
        else{$b[$i++]=[Drawing.Brushes]::White}
      }
      for($j=($l+0);$j-lt($l+30);$j+=10){
        ($k+0),($k+10),($k+20)|%{$g.FillRectangle($b[$c++],$_,$j,10,10)}
      }$k+=31
    }$k=0;$l+=31;$m+=32
  }
}$a.save("$HOME/3X3_Grid.png")
```
[![enter image description here](https://i.stack.imgur.com/95M6A.png)](https://i.stack.imgur.com/95M6A.png)
[Answer]
## Python 2, 49 bytes
```
i=2048;exec"print bin(i/4)[i%4*3+3:][:3];i+=1;"*i
```
Split the binary expansion of `i`. The length-10 binary values 512 through 1023 are used, cutting off the initial 1 (and prefix `0b`). These are split into chunks of 3 as windows `[3:6]`, `[6:9]`, `[9:12]`, and `[12:15]`, with the last one blank to make a blank line. Iterating over the four slices is collapsed with the outer loop of counting through 512 numbers with the divmod trick.
[Answer]
# CJam, 12 bytes
```
2,9m*3f/N*N*
```
[Test it here.](http://cjam.aditsu.net/#code=2%2C9m*3f%2FN*N*)
Uses `0` and `1` as the distinct characters.
## Explanation
```
2,  e# Push [0 1].
9m* e# Generate all 9-tuples of 0s and 1s.
3f/ e# Split each 9-tuple into 3 subarrays of length 3.
N*  e# Join all those grids with newlines.
N*  e# Put newlines between all the length-3 arrays.
```
An alternative (still 12 byte) solution is
```
2,3m*3m*N*N*
```
[Answer]
## Ruby, 86 bytes
```
0.upto(511).map{|i|i.to_s(2).rjust(9,'0')}.each{|j|p j[0..2];p j[3..5];p j[6..8];puts}
```
Mine prints with quotes because `p` is shorter than `puts`, but it does still fit the rules.
[Answer]
# Haskell, ~~57~~ 54 bytes
```
r x=sequence[x,x,x]
u=unlines
f=putStr$u$map u$r$r".X"
```
`f` gives the same output as in the challenge description, i.e. it starts with
```
...
...
...
...
...
..X
...
...
.X.
```
Edit: @Mauris found 3 bytes to save. Thanks!
[Answer]
# C# - 111
```
for(int i=0;i<512;i++)Console.WriteLine(Regex.Replace(Convert.ToString(i,2).PadLeft(9,'0'),"(.{3})","$1\r\n"));
```
Converts every int to its binary representation and splits every 3 chars.
[Answer]
# Python 2, 95 Bytes
Distinct characters are `0` and `1`, each block is separated by `\n\n`.
```
n='\n';print(n+n).join(y[:3]+n+y[3:6]+n+y[-3:]for y in[bin(x)[2:].zfill(9)for x in range(512)])
```
[Answer]
# Python 2, 81
```
import re
for i in range(512):print re.sub('(.{3})','\\1\n',bin(i)[2:].zfill(9))
```
[Answer]
## Ruby, 92 bytes
```
0.upto(511){|i|("%09d"%i.to_s(2)).scan(/.{3}/).map{|j|j.scan(/./)}.map{|j|puts j.join};puts}
```
Counts in `0`s and `1`s, and each block is separated by an empty line (`\n\n`)
[Answer]
# Ruby, 68 bytes
Prints the exact same output as the example given in the question
```
puts (0..511).map{|i|("%09b"%i).tr("01",".X").gsub(/.../){$&+$/}}*$/
```
[Answer]
# Python 3, 80 bytes
```
for i in range(512):print("\n".join(format(i,'09b')[j:j+3]for j in(0,3,6)),"\n")
```
I managed to outgolf someone :)
[Answer]
# PHP, 55 bytes
```
for(;$c<512;)echo chunk_split(sprintf("%09b ",$c++),3);
```
uses `0` and `1`. Run with `-r`.
[Answer]
# Pyth, 11 bytes
```
V^`T9jbc3Nk
```
[**Try it here!**](https://pyth.herokuapp.com/?code=V%5E%60T9jbc3Nk&debug=0)
Thanks @Jakube :)
[Answer]
# [Python 2](https://docs.python.org/2/), 56 bytes
```
from itertools import*
print set(combinations('X.'*9,9))
```
[Try it online!](https://tio.run/##K6gsycjPM/r/P60oP1chsyS1qCQ/P6dYITO3IL@oRIuroCgzr0ShOLVEIzk/NykzL7EkMz@vWEM9Qk9dy1LHUlPz/38A "Python 2 – Try It Online")
Returns the 512 configurations as a set object in python. Refer to ungolfed version to make output more readable.
Ungolfed Version to make output more readable:
# [Python 2](https://docs.python.org/2/), 121 bytes
```
from itertools import*
for i in set(combinations('X.'*9,9)):
	for j in range(3):print''.join(list(i))[j*3:(j*3)+3]
	print
```
[Try it online!](https://tio.run/##HcqxDsIgEADQuXwFGweaDjKVLzExDtVQPVLuyHGLX4/W5U2vffTNdBljE64WNYsy791ibSwazMZi0SLZnhWeXB9IqyJTB3edXVjOi/fJTEcrR5OVXhmiT02Q1Lm5MBLs2BXQ@1sJMcEPf4p3M/3PGF8 "Python 2 – Try It Online")
[Answer]
# C - 97 bytes
```
i;main(j){for(;i++<512;)for(j=0;j++<13;)putchar(j%4&&j<13?i%(1<<j-j/4)>(1<<j-j/4-1)-1?88:46:10);}
```
Basically prints the example output from the original question.
[Answer]
## Swift 2, 92 bytes
Int to binary string in Swift takes up too many chars so I just use two nested loops...
```
var s="";for x in 0..<512{(0..<9).map{s+=($0%3==0 ?"\n":"")+"\(x>>$0&1)"};s+="\n-"};print(s)
```
[Answer]
# Prolog (SWI), 98 bytes
Output is a list of 3x3 matrices containing the elements 0 and 1.
```
r([]).
r([H|T]):-between(0,1,H),r(T).
p(Y):-Z=[[_,_,_],[_,_,_],[_,_,_]],findall(Z,maplist(r,Z),Y).
```
[Online interpreter](http://swish.swi-prolog.org/p/DEEQVgbL.pl)
I feel like the matrix generation could be shorter.  
It should be possible to fit the between in a forall or something similar, but I can't figure out how.
Golfing tips appreciated.
[Answer]
# Perl, ~~56~~ 55 bytes
```
print$_/9&1<<$_%9?1:0,$/x(!(++$_%3)+!($_%9))for+0..4607
```
Output:
```
000
000
000
100
000
000
...
```
[Answer]
# Python 3, 123 121 109 103 bytes
Here is my old one:
```
import itertools
[print(a+b+c,d+e+f,g+h+i,'\n',sep='\n') for a,b,c,d,e,f,g,h,i in itertools.product(['X','.'],repeat=9)]
```
And here is my new one:
```
import itertools as i
[print(a[:3],a[3:6],a[6:],'\n',sep='\n') for a in i.product(['X','.'],repeat=9)]
```
This prints extra characters but the OP said ASCII art is allowed which implies multiple characters are fine.
[Answer]
# **Python 3, 74 bytes**
```
i=512;b="\n"
while i:i-=1;a=format(i,'09b');print(a[:3]+b+a[3:6]+b+a[6:],b)
```
Just a little shorter than Destructible Lemon's answer
[Answer]
## [Perl 5](https://www.perl.org/), 32 bytes
```
$_=("{.,#}"x3 .$/)x3;say<"$_\n">
```
[Try it online!](https://tio.run/##K0gtyjH9/18l3lZDqVpPR7lWqcJYQU9FX7PC2Lo4sdJGSSU@Jk/J7v//f/kFJZn5ecX/dX1N9QwMDQA "Perl 5 – Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 9 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
T3ã¶«3ãJ»
```
Uses the digits `[1,0]`. The `T` could be replaced with `₂`, `₃`, or `₆` to use the digits `[2,6]`, `[9,5]`, or `[3,6]` respectively.
[Try it online.](https://tio.run/##yy9OTMpM/f8/xPjw4kPbDq0GUl6Hdv//DwA)
Outputting as an unformatted list could have been **5 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)**: [`T3ã3ã`](https://tio.run/##yy9OTMpM/f8/xPjwYiD6/x8A).
**Explanation:**
```
T          # Push 10
 3ã        # Take the cartesian power of 3 with its digits:
           #  ["111","110","101",...,"000"]
   ¶«      # Append a newline to each triplet
           #  ["111\n","110\n","101\n",...,"000\n"]
     3ã    # Take the cartesian power of 3 with this list of strings:
           #  [["111\n","111\n","111\n"],["111\n","111\n","110\n"],...,["000\n","000\n","000\n"]]
       J   # Join each inner list together
           #  ["111\n111\n111\n","111\n111\n110\n",...,"000\n000\n000\n"]
        »  # And join that list by newlines
           #  "111\n111\n111\n\n111\n111\n110\n\n...\n000\n000\n000\n"
           # (after which it is output implicitly as result)
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 15 bytes
```
žAFNžA+b¦3ô»,¶?
```
[Try it online!](https://tio.run/nexus/05ab1e#@390n6ObH5DQTjq0zPjwlkO7dQ5ts///HwA "05AB1E – TIO Nexus")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 17 bytes
```
512+ḶBḊ€s€3Y€j“¶¶
```
[Try it online!](https://tio.run/nexus/jelly#@29qaKT9cMc2p4c7uh41rSkGYuNIIJH1qGHOoW2Htv3/DwA "Jelly – TIO Nexus")
Uses `01`. Because of a bug in `⁾`, I had to use `“¶¶` instead of `⁾¶¶`, because otherwise, instead of two newlines, two pilcrows would have showed up in the output. As you can see, though, that didn't cost me any bytes at all.
K beats this, so this must be further golfed down.
[Answer]
# [Ruby](https://www.ruby-lang.org/), 42 bytes
```
512.times{puts ("%09b"%_1).scan(/.../),$/}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72kqDSpcsGCpaUlaboWN7VMDY30SjJzU4urC0pLihU0lFQNLJOUVOMNNfWKkxPzNPT19PT0NXVU9GshOqAaYQYAAA)
[Answer]
# [Uiua](https://www.uiua.org), 12 bytes
```
≡(↯3_3)⋯⇡512
```
Outputs an array of 512 3x3 bit matrices. Makes clever use of the `bits ⋯` primitive, which converts all numbers in an array to lists of bits.
With `&gifs`, you can make a very tiny GIF cycling every grid.
[Pad, GIF version](https://uiua.org/pad?src=0_8_0__4omhKOKGrzNfMynii6_ih6E1MTIgIyBNYWluIGNvZGUKJmdpZnMgMTIK)
]