Skip to main content
deleted 25 characters in body
Source Link
hyperneutrino
  • 42.6k
  • 5
  • 68
  • 224

Vyxal, 2524 bytes

:±+ʁ:±†vǔd$ʁ:v+∷+ṘR2v+∷+2(ømÞTṘømÞT

Try It Online!Try It Online!

-3 bytes thanks to lyxal
-1 byte thanks to Unrelated String

:±+ʁ:±†vǔd$ʁ:v+∷+ṘR2v+∷+2(ømÞTṘømÞT     Full Program; take in order b, a
:                            duplicate b
 ±                           sign
  +                          add (0 if b is 0, otherwise b+1)
   ʁ                         range (0..x-1)
    :                        duplicate
     ±                       sign ([0, 1, 1, ..., 1] of length 0 / b+1)
      †                      logical NOT - [1, 0, 0, ..., 0]
       vǔ                    vectorized rotate; identity matrix of size 0 / b+1
         d                   double; [2, 0, 0], [0, 2, 0], [0, 0, 2]
          $                  swap a to TOS
           ʁ                 range; 0..a-1
            :                duplicate
             v+              add each; addition table; [2, 3, 4], [3, 4, 5], [4, 5, 6]
               ∷             parity; checkerboard of size a with 0 in top-left
                +            add the two matrices together
                    2(....)   reverse (fliprepeat vertical)twice
                  R          reverse (flip horizontal)
                   2(....vertical)   repeat twice
                     øm      palindromize (reflect vertical; do not copy middle)
                       ÞT    transpose

Vyxal, 25 bytes

:±+ʁ:±†vǔd$ʁ:v+∷+ṘR2(ømÞT

Try It Online!

-3 bytes thanks to lyxal

:±+ʁ:±†vǔd$ʁ:v+∷+ṘR2(ømÞT    Full Program; take in order b, a
:                            duplicate b
 ±                           sign
  +                          add (0 if b is 0, otherwise b+1)
   ʁ                         range (0..x-1)
    :                        duplicate
     ±                       sign ([0, 1, 1, ..., 1] of length 0 / b+1)
      †                      logical NOT - [1, 0, 0, ..., 0]
       vǔ                    vectorized rotate; identity matrix of size 0 / b+1
         d                   double; [2, 0, 0], [0, 2, 0], [0, 0, 2]
          $                  swap a to TOS
           ʁ                 range; 0..a-1
            :                duplicate
             v+              add each; addition table; [2, 3, 4], [3, 4, 5], [4, 5, 6]
               ∷             parity; checkerboard of size a with 0 in top-left
                +            add the two matrices together
                       reverse (flip vertical)
                  R          reverse (flip horizontal)
                   2(....)   repeat twice
                     øm      palindromize (reflect vertical; do not copy middle)
                       ÞT    transpose

Vyxal, 24 bytes

:±+ʁ:±†vǔd$ʁ:v+∷+2(ṘømÞT

Try It Online!

-3 bytes thanks to lyxal
-1 byte thanks to Unrelated String

:±+ʁ:±†vǔd$ʁ:v+∷+2(ṘømÞT     Full Program; take in order b, a
:                            duplicate b
 ±                           sign
  +                          add (0 if b is 0, otherwise b+1)
   ʁ                         range (0..x-1)
    :                        duplicate
     ±                       sign ([0, 1, 1, ..., 1] of length 0 / b+1)
      †                      logical NOT - [1, 0, 0, ..., 0]
       vǔ                    vectorized rotate; identity matrix of size 0 / b+1
         d                   double; [2, 0, 0], [0, 2, 0], [0, 0, 2]
          $                  swap a to TOS
           ʁ                 range; 0..a-1
            :                duplicate
             v+              add each; addition table; [2, 3, 4], [3, 4, 5], [4, 5, 6]
               ∷             parity; checkerboard of size a with 0 in top-left
                +            add the two matrices together
                  2(....)    repeat twice
                            reverse (flip vertical)
                     øm      palindromize (reflect vertical; do not copy middle)
                       ÞT    transpose
deleted 36 characters in body
Source Link
hyperneutrino
  • 42.6k
  • 5
  • 68
  • 224

-23 bytes thanks to lyxal
-1 byte thanks to Unrelated String

-2 bytes thanks to lyxal
-1 byte thanks to Unrelated String

-3 bytes thanks to lyxal

added 33 characters in body
Source Link
hyperneutrino
  • 42.6k
  • 5
  • 68
  • 224
:±+ʁ:±†vǔd$ʁ:v+∷+ṘR2(ømÞT    Full Program; take in order b, a
:                            duplicate b
 ±                           sign
  +                          add (0 if b is 0, otherwise b+1)
   ʁ                         range (0..x-1)
    :                        duplicate
     ±                       sign ([0, 1, 1, ..., 1] of length 0 / b+1)
      †                      logical NOT - [1, 0, 0, ..., 0]
       vǔ                    vectorized rotate; identity matrix of size 0 / b+1
         d                   double; [2, 0, 0], [0, 2, 0], [0, 0, 2]
          $                  swap a to TOS
           ʁ                 range; 0..a-1
            :                duplicate
             v+              add each; addition table; [2, 3, 4], [3, 4, 5], [4, 5, 6]
               ∷             parity; checkerboard of size a with 0 in top-left
                +            add the two matrices together
                 Ṙ           reverse (flip vertical)
                  R          reverse (flip horizontal)
                   2(....)   repeat twice
                     øm      palindromize (reflect vertical; do not copy middle)
                       ÞT    transpose
:±+ʁ:±†vǔd$ʁ:v+∷+ṘR2(ømÞT    Full Program; take in order b, a
:                            duplicate b
 ±                           sign
  +                          add (0 if b is 0, otherwise b+1)
   ʁ                         range (0..x-1)
    :                        duplicate
     ±                       sign ([0, 1, 1, ..., 1] of length 0 / b+1)
      †                      logical NOT - [1, 0, 0, ..., 0]
       vǔ                    vectorized rotate; identity matrix of size 0 / b+1
         d                   double; [2, 0, 0], [0, 2, 0], [0, 0, 2]
          $                  swap a to TOS
           ʁ                 range; 0..a-1
            :                duplicate
             v+              add each; addition table; [2, 3, 4], [3, 4, 5], [4, 5, 6]
               ∷             parity; checkerboard of size a with 0 in top-left
                +            add the two matrices together
                 Ṙ           reverse (flip vertical)
                  R          reverse (flip horizontal)
                   2(....)   repeat twice
                     øm      palindromize (reflect vertical; do not copy middle)
                       ÞT    transpose
added 33 characters in body
Source Link
hyperneutrino
  • 42.6k
  • 5
  • 68
  • 224
Loading
Source Link
hyperneutrino
  • 42.6k
  • 5
  • 68
  • 224
Loading