Skip to main content
added 37 characters in body
Source Link
gastropner
  • 4.4k
  • 1
  • 15
  • 20

C (gcc), 158158 153 bytes

-5 bytes thanks to ceilingcat.

i,l,s;p(c,s){printf("%*c%*.*s%c\n",i*2+1i-~i,c,l,l,s,c);}f(n){s=memset(malloc(5*n),45,5*n);for;l=1;for(i=n;i--;p('|',""))l=(n-i)*4+1l+=4,n-1^in+~i?p(43,s):p(32,"_|_|_");p(43,s);}

Try it online!Try it online!

C (gcc), 158 bytes

i,l,s;p(c,s){printf("%*c%*.*s%c\n",i*2+1,c,l,l,s,c);}f(n){s=memset(malloc(5*n),45,5*n);for(i=n;i--;p('|',""))l=(n-i)*4+1,n-1^i?p(43,s):p(32,"_|_|_");p(43,s);}

Try it online!

C (gcc), 158 153 bytes

-5 bytes thanks to ceilingcat.

i,l,s;p(c,s){printf("%*c%*.*s%c\n",i-~i,c,l,l,s,c);}f(n){s=memset(malloc(5*n),45,5*n);l=1;for(i=n;i--;p('|',""))l+=4,n+~i?p(43,s):p(32,"_|_|_");p(43,s);}

Try it online!

Source Link
gastropner
  • 4.4k
  • 1
  • 15
  • 20

C (gcc), 158 bytes

i,l,s;p(c,s){printf("%*c%*.*s%c\n",i*2+1,c,l,l,s,c);}f(n){s=memset(malloc(5*n),45,5*n);for(i=n;i--;p('|',""))l=(n-i)*4+1,n-1^i?p(43,s):p(32,"_|_|_");p(43,s);}

Try it online!