Skip to main content
7 of 7
added 57 characters in body
AZTECCO
  • 11k
  • 1
  • 17
  • 60

C (clang), 170 147 143 137 bytes

a,j,i;f(*m,x,z){for(;*m;m+=x)for(j=z;j--;puts(""))for(i=-1;++i<x*z;putchar((a-92?a-47?a-45?a-95|j:j-~j-z:i%z-j:~j+z-i%z)?32:a))a=m[i/z];} 

Try it online!

  • thanks to @ceilingcat suggestion !
  • added for loop instead of recursion
  • thanks to @Johan du Toit for suggesting using int*array as input!

f(*m,x,z){ function taking:

  • m : char int array without newlines
  • x : width
  • z : scale

m+=x;*m&&f(m,x,z); => for(;*m;m+=x)
for every row of input, loop actually better than recursion.

for(j=z;j--;puts(""))
we iterate z times every row of input and put \n each time.

for(i=-1;++i<x*z;putchar(..) )
we put x*z characters.

a=m[i/z]
we use a to save on m[i/z] repetitions which is current input being enlarged.

putchar(( ... )?32:a
... => many nested ternary operators to select proper character based on a and i / j relations which evaluates to 1 or 0 , we then puts a space or a.

AZTECCO
  • 11k
  • 1
  • 17
  • 60