Skip to main content
added 1109 characters in body
Source Link
Jonathan Allan
  • 115.5k
  • 8
  • 68
  • 293
2ŻŻŒB+þ`ƽị“xo ”G - Main Link 2 - two Ż - zero-range -> [0,1,2] Ż - prefix with a zero -> [0,0,1,2] ŒB - bounce -> [0,0,1,2,1,0,0] +þ` - table of addition -> [[0, 0, 1, 2, 1, 0, 0], [0, 0, 1, 2, 1, 0, 0], [1, 1, 2, 3, 2, 1, 1], [2, 2, 3, 4, 3, 2, 2], [1, 1, 2, 3, 2, 1, 1], [0, 0, 1, 2, 1, 0, 0], [0, 0, 1, 2, 1, 0, 0]] ƽ - integer square-root (0->0; 1,2,3->1; 4->2) ị“xo ” - 1-index, cyclically into "xo " G - format as a grid (add adjoining spaces and newline characters) - implicit, smashing print 
2ŻŻŒB+þ`ƽị“xo ”G - Main Link 2 - two Ż - zero-range -> [0,1,2] Ż - prefix with a zero -> [0,0,1,2] ŒB - bounce -> [0,0,1,2,1,0,0] +þ` - table of addition -> [[0, 0, 1, 2, 1, 0, 0], [0, 0, 1, 2, 1, 0, 0], [1, 1, 2, 3, 2, 1, 1], [2, 2, 3, 4, 3, 2, 2], [1, 1, 2, 3, 2, 1, 1], [0, 0, 1, 2, 1, 0, 0], [0, 0, 1, 2, 1, 0, 0]] ƽ - integer square-root ị“xo ” - index into "xo " G - format as a grid (add adjoining spaces and newline characters) - implicit, smashing print 
2ŻŻŒB+þ`ƽị“xo ”G - Main Link 2 - two Ż - zero-range -> [0,1,2] Ż - prefix with a zero -> [0,0,1,2] ŒB - bounce -> [0,0,1,2,1,0,0] +þ` - table of addition -> [[0, 0, 1, 2, 1, 0, 0], [0, 0, 1, 2, 1, 0, 0], [1, 1, 2, 3, 2, 1, 1], [2, 2, 3, 4, 3, 2, 2], [1, 1, 2, 3, 2, 1, 1], [0, 0, 1, 2, 1, 0, 0], [0, 0, 1, 2, 1, 0, 0]] ƽ - integer square-root (0->0; 1,2,3->1; 4->2) ị“xo ” - 1-index, cyclically into "xo " G - format as a grid (add adjoining spaces and newline characters) - implicit, smashing print 
added 1109 characters in body
Source Link
Jonathan Allan
  • 115.5k
  • 8
  • 68
  • 293

I do quite like the more mathsy, \$17\$ bytes - Try it online!:

2ŻŻŒB+þ`ƽị“xo ”G - Main Link 2 - two Ż - zero-range -> [0,1,2] Ż - prefix with a zero -> [0,0,1,2] ŒB - bounce -> [0,0,1,2,1,0,0] +þ` - table of addition -> [[0, 0, 1, 2, 1, 0, 0], [0, 0, 1, 2, 1, 0, 0], [1, 1, 2, 3, 2, 1, 1], [2, 2, 3, 4, 3, 2, 2], [1, 1, 2, 3, 2, 1, 1], [0, 0, 1, 2, 1, 0, 0], [0, 0, 1, 2, 1, 0, 0]] ƽ - integer square-root ị“xo ” - index into "xo " G - format as a grid (add adjoining spaces and newline characters) - implicit, smashing print 

...which is the same length as not using the integer square-root, with:

2ŻŻŒB+þ`ị“xxxo ”G 

I do quite like the more mathsy, \$17\$ bytes - Try it online!:

2ŻŻŒB+þ`ƽị“xo ”G - Main Link 2 - two Ż - zero-range -> [0,1,2] Ż - prefix with a zero -> [0,0,1,2] ŒB - bounce -> [0,0,1,2,1,0,0] +þ` - table of addition -> [[0, 0, 1, 2, 1, 0, 0], [0, 0, 1, 2, 1, 0, 0], [1, 1, 2, 3, 2, 1, 1], [2, 2, 3, 4, 3, 2, 2], [1, 1, 2, 3, 2, 1, 1], [0, 0, 1, 2, 1, 0, 0], [0, 0, 1, 2, 1, 0, 0]] ƽ - integer square-root ị“xo ” - index into "xo " G - format as a grid (add adjoining spaces and newline characters) - implicit, smashing print 

...which is the same length as not using the integer square-root, with:

2ŻŻŒB+þ`ị“xxxo ”G 
Source Link
Jonathan Allan
  • 115.5k
  • 8
  • 68
  • 293

Jelly, 16 bytes

⁽doṃ⁾ x;0s4ŒBŒḄG 

A full program printing to stdout.

Try it online!

How?

⁽doṃ⁾ x;0s4ŒBŒḄG - Main Link: no arguments ⁽do - 26112 ṃ⁾ x - cast to base 2 with 1 as " " and 0 as "x" ;0 - concatenate a zero s4 - split into fours -> top-left ŒB - bounce each row -> top half ŒḄ - bounce -> whole board G - format as a grid (add adjoining spaces and newline characters) - implicit, smashing print