Skip to main content
2 of 3
added 694 characters in body
Jonah
  • 34.1k
  • 4
  • 41
  • 95

J, 36 bytes

(' ','#.'$~#){~[:+/(-@[|.!.0]$1:)/"2 

Try it online!

We take input as a list of 2x2 matrices.

  • For each of them "2, draw a box of ones 1: of the same shape $ as the right input ], ie, the coords of the bottom right of the box.
  • Then rotate that down and to the right with 0 fill |.!.0 until the upper leftmost 1 is in the coords specified by the left arg -@[.
  • [:+/ Sum the resulting matrices elementwise. J guarantees they will be the same size by adding 0 fill to the right. This will produce a single matrix with integers 0, 1, 2, 3, etc. We'll use those to index into our ascii chars {~.
  • '#.'$~# Repeat the pattern #. cyclically $~ to the input length #, and then prepend a space ' ',.
Jonah
  • 34.1k
  • 4
  • 41
  • 95