Skip to main content
2 of 3
added 540 characters in body
Luis Mendo
  • 105.3k
  • 9
  • 135
  • 372

MATL, 15 bytes

4:"3tYL@X!0cyPy

Try it online!

How it works

4:      % Range [1 2 3 4]
"       % For each k in that range
  3tYL  %   Magic square of size 3 (gives one of the 8 possible squares)
  @     %   Push k
  X!    %   Rotate matrix 90 degrees k times
  0c    %   Push character 0 (displayed as space). Used as separator
  y     %   Duplicate from above: pushes copy of the latest matrix
  P     %   Flip vertically
  y     %   Duplicate from above: pushes character 0 again
        % End (implicit)
        % Display stack, bottom to top (implicit)
Luis Mendo
  • 105.3k
  • 9
  • 135
  • 372