| Bytes | Lang | Time | Link |
|---|---|---|---|
| 059 | Jelly | 240823T232413Z | Jonathan |
| 165 | JavaScript ES6 | 240823T150937Z | Arnauld |
| 087 | Charcoal | 240825T122525Z | Neil |
| 225 | APL+WIN | 240824T131230Z | Graham |
Jelly, 65 60 59 bytes
-3 leading to two three more thanks to emanresu A (join with spaces, giving blank lines a trailing space).
Whew!
4R8œ?$ṚƭƬ;"`p`ḣ4Jx4ṁƲ;$Q“ṅ⁷Ṇݧ‘Bp⁶¤;"œ?@€€Ƭ⁽¥ọẎŒH€Z€zɗ€⁶KYF
A full program that takes no input and prints the combined bricks and squares of the MOG as they appear in:
in row-major order, using:
0(white) and1(black) in the bricks and1-4(black, white, circle, dot) in the squares.
Blank lines each have a single, trailing space character.
How?
First, build the four rightmost squares of the top row with each in column-major order split into two:
4R8œ?$ṚƭƬ;"`p`ḣ4
4R - range 4 -> [1,2,3,4]
Ƭ - collect up while distinct, applying:
ƭ - in turn:
$ - a) last two links as a monad:
8 - get the eighth
œ? - lexicographic permutation
Ṛ - b) reverse
` - use {that} as both arguments of:
" - zip with:
; - concatenate
` - use {that} as both arguments of:
p - Cartesian product
ḣ4 - keep the first four
Now prefix that with the top-left square in the same format:
Jx4ṁƲ;$Q
$ - last two links as a monad - f(TopRightSquares):
Ʋ - last four links as a monad:
J - indices -> [1,2,3,4]
4 - four
x - times -> [1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4]
ṁ - mould like {TopRightSquares}
; - concatenate {TopRightSquares}
Q - deduplicate
Now add the top five blocks to their respective squares:
“ṅ⁷Ṇݧ‘Bp⁶¤;"
¤ - nilad followed by link(s) as a nilad:
“ṅ⁷Ṇݧ‘ - Code-page indices -> [240,135,180,210,225]
B - convert to binary
p⁶ - Cartesian product with a space character
(this a seed for the column of spaces, later)
" - zip with {TopFiveSquares} with:
; - concatenate
Now add the other twenty-eight blocks and squares using the five constructed so far:
œ?@€€Ƭ⁽¥ọẎ
Ƭ - collect up while distinct, applying:
€€ - for each {TwoColumnList} of each {Block&Square}:
œ?@ ⁽¥ọ - 2222nd lexicographic permutation
Ẏ - tighten to a list of the 35 Block&Squares
Now reformat and print:
ŒH€Z€zɗ€⁶KYF
⁶ - space character
ɗ€ - last three links for each as a dyad - f(Block&Square, SpaceCharacter)
ŒH€ - split each into two
Z€ - transpose each
Z - transpose
z - transpose with filler {SpaceCharacter}
(extending the single space from the `,€⁶`, earlier, to a column)
K - join with space characters
Y - join with newline characters
F - flatten
- implicit print
JavaScript (ES6), 165 bytes
Returns a string with newlines, using the symbols suggested in the challenge.
f=(p=5)=>p--?(g=(k,b,h=i=>i>23?`
`+g(k,h):"X-O+"[x=i%6,y=i/6,h[i++]=b?b[3*(y*25&6)+x^y&1]:p>3?57%~x:[p!=~~y,y,p^y][x>>1]^!x]+[`
`[~-x/4]]+h(i))=>k--?h``:f(p))(7):""
Generating the main patterns
Below are the 5 main patterns which are generated in this order, from \$p=4\$ to \$p=0\$:
Each row in the first pattern is filled with the sequence 0,1,0,1,2,3 which is obtained with the formula 57 % ~x.
For the other patterns:
- the cells of the 1st column are set to \$1\$ if \$y=p\$ or \$0\$ otherwise
- each cell in the 2nd column is the complement of its neighbor in the 1st column
- the next 2 columns are set to \$y\$
- the last 2 columns are set to \$y\operatorname{xor} p\$
Deriving the other patterns
The other patterns are generated by applying the following transformation 6 times:
$$\begin{pmatrix}a&b&\color{blue}i&\color{blue}j&\color{green}q&\color{green}r\\c&d&\color{blue}k&\color{blue}l&\color{green}s&\color{green}t\\e&f&\color{blue}m&\color{blue}n&\color{green}u&\color{green}v\\g&h&\color{blue}o&\color{blue}p&\color{green}w&\color{green}x\end{pmatrix}\rightarrow\begin{pmatrix}a&f&\color{blue}i&\color{blue}n&\color{green}q&\color{green}v\\b&e&\color{blue}j&\color{blue}m&\color{green}r&\color{green}u\\c&h&\color{blue}k&\color{blue}p&\color{green}s&\color{green}x\\d&g&\color{blue}l&\color{blue}o&\color{green}t&\color{green}w\end{pmatrix}$$
A pattern is internally stored as a flat array, filled by reading the elements of the matrix from left to right and top to bottom.
Therefore, the actual transformation is processed by filling the target array with the elements at the following positions from the source array:
[ 0, 13, 2, 15, 4, 17, 1, 12, 3, 14, 5, 16, 6, 19, 8, 21, 10, 23, 7, 18, 9, 20, 11, 22 ]
This sequence is obtained with:
$$a_i=\left(3\times\left(\left\lfloor\frac{i\times25}{6}\right\rfloor\operatorname{and}6\right)+(i\bmod 6)\right)\operatorname{xor}\left(\left\lfloor \frac{i}{6} \right\rfloor\bmod 2\right)$$
Or in JS, with x = i % 6 and y = i / 6:
3 * (y * 25 & 6) + x ^ y & 1
Charcoal, 87 bytes
⊞υ⭆+O-X-X×⁴ιF⁴⊞υ⁺⭆¹⁶§X-O+⎇›κ⁷κ⁻|κι&κι⭆²⭆⁴§-X⁼¬ι⁼κ⁼μιF³⁵«⊞υ⭆⪪§υι⁸⭆⁸§κ⊘⁺⁴×⁹μ↓⪪⪪§υι⁴¦⁴M⁸¦⁵
Try it online! Link is to verbose version of code. Explanation: Uses the method of the linked PDF but outputs the results in row-major rather than column-major order.
⊞υ⭆+O-X-X×⁴ι
Each block is represented by 24 characters as viewed with a 90° rotation, so the first block is ++++OOOO----XXXX----XXXX.
F⁴⊞υ⁺⭆¹⁶§X-O+⎇›κ⁷κ⁻|κι&κι⭆²⭆⁴§-X⁼¬ι⁼κ⁼μι
Generate the next four blocks.
F³⁵«
Repeat for each of the 35 octads.
⊞υ⭆⪪§υι⁸⭆⁸§κ⊘⁺⁴×⁹μ
Generate the n+5th octad by splitting the current octad into groups of 8, then within each group cyclically taking every 4½th character starting at the third.
↓⪪⪪§υι⁴¦⁴
Output the current octad, but pretty-printed and rotated.
M⁸¦⁵
Move to where the next octad is to be printed.
APL+WIN, 225 bytes
i←1 6 2 5 3 8 4 7
a←b←'X-X-X-X-'⋄c←'O+O+O+O+'
r←'((4 2⍴a),'' '',(4 2⍴b),(4 2⍴c))⍪'' ''⋄'
s←r,∊6⍴⊂'a←a[i]⋄b←b[i]⋄c←c[i]⋄',r
⍎s
x←a←'X--X-X-X'⋄c←b←d←'XX--OO++'
⍎s
y←a←'X--XX-X-'⋄b←d⋄c←4⌽⌽d
⍎s
a←6⌽y⋄b←d⋄c←4⌽d
⍎s
a←⌽x⋄b←d⋄c←⌽d
⍎s
Try it online! Thanks to Dyalog Classic
Explanation by row of the function
[1] assign the indices to do the Singer 7-cycle as described in the example link
[2] assign the first main brick, the first 2 columns and the second 2 columns of the first main block as 8 element vectors
[3] format the output in the required form
[4] define the code to carry out the Singer 7-cycle for the first main brick and block and the 6 bricks and blocks under them and output the results
[5]execute that code
[6-13] repeat [2] and [5] for each main brick and block in turn with some attempt to golf the input vectors

