Post History
C (clang), 116 102 bytes j,k;f(i){for(j=i;j--;printf("#"));for(j=i-1;j--;printf("#"))for(k=i-2,printf("\n#");k--;printf(" "));} Try it online! Sometimes, it's better to use functions when yo...
Answer
#2: Post edited
# [C (clang)], 116 bytes- <!-- language-all: lang-c -->
j,k;f(i){for(j=0;j<i;printf("#"),j++);for(j=0;j<i-1;j++){printf("\n#");for(k=0;k<i-2;printf(" "),k++);printf("#");}}[Try it online!][TIO-kt7vsxgm]- Sometimes, it's better to use functions when you're not restricted from using it.
- [C (clang)]: http://clang.llvm.org/
[TIO-kt7vsxgm]: https://tio.run/##S9ZNzknMS///P0sn2zpNI1OzOi2/SCPL1sA6yybTuqAoM68kTUNJWUlTJ0tbW9MaSVLX0BokVA1TE5MHVAVWkA1UkA1UYATXrwDUnw3Sj2SgdW3t/9zEzDwNzWouzjQNU6BkaUkxyBygHEjEHEjV/gcA "C (clang) – Try It Online"
- # [C (clang)], <s>116</s> 102 bytes
- <!-- language-all: lang-c -->
- j,k;f(i){for(j=i;j--;printf("#"));for(j=i-1;j--;printf("#"))for(k=i-2,printf("\n#");k--;printf(" "));}
- [Try it online!][TIO-kt7xzb3b]
- Sometimes, it's better to use functions when you're not restricted from using it.
- Golfed 14 bytes thanks to [**@Moshi**](https://codegolf.codidact.com/users/53196)'s [advice](https://codegolf.codidact.com/comments/thread/4396#comment-13402).
- [C (clang)]: http://clang.llvm.org/
- [TIO-kt7xzb3b]: https://tio.run/##S9ZNzknMS///P0sn2zpNI1OzOi2/SCPLNtM6S1fXuqAoM68kTUNJWUlT0xoqoWuIIQWSyQbKGOnARGPygOLW2UjqFEBG1P7PTczM09Cs5uJM0zDVtC4oLSkGKQaqBYmYY4gYGgDp2v8A "C (clang) – Try It Online"
#1: Initial revision
# [C (clang)], 116 bytes <!-- language-all: lang-c --> j,k;f(i){for(j=0;j<i;printf("#"),j++);for(j=0;j<i-1;j++){printf("\n#");for(k=0;k<i-2;printf(" "),k++);printf("#");}} [Try it online!][TIO-kt7vsxgm] Sometimes, it's better to use functions when you're not restricted from using it. [C (clang)]: http://clang.llvm.org/ [TIO-kt7vsxgm]: https://tio.run/##S9ZNzknMS///P0sn2zpNI1OzOi2/SCPL1sA6yybTuqAoM68kTUNJWUlTJ0tbW9MaSVLX0BokVA1TE5MHVAVWkA1UkA1UYATXrwDUnw3Sj2SgdW3t/9zEzDwNzWouzjQNU6BkaUkxyBygHEjEHEjV/gcA "C (clang) – Try It Online"