Skip to main content
5 of 7
added 6 characters in body
att
  • 21.7k
  • 2
  • 16
  • 62

R, 205 153 147 136 132 bytes

-52 from Dominic van Essen.
-4 from Giuseppe.
-4 again thanks to Giuseppe.

function(s,n=nchar(s),f=ifelse,r=abs(x<--n:n))for(y in-n:n*2)cat(f((i=(t=y-2*r*!r<y)*t-t-f(r<y,x,-x)+1)>n," ",substring(s,i,i)),"
")

Try it online!

att
  • 21.7k
  • 2
  • 16
  • 62