Post History
C (gcc), 119 118 116 115 bytes #define p(x,y,z) printf(i^1?i^c?#z:#y:#x) i,j;f(c){for(i=1;i<=c;p(╗\n,╝\n,╣\n),i++)for(j=p(╔,╚,╠);j++<c;)p(╦,╩,╬);} Try it online! Function solution. I...
Answer
#11: Post edited
- # [C (gcc)], <strike>119 118 116</strike> 115 bytes
- <!-- language-all: lang-c -->
- #define p(x,y,z) printf(i^1?i^c?#z:#y:#x)
- i,j;f(c){for(i=1;i<=c;p(╗\n,╝\n,╣\n),i++)for(j=p(╔,╚,╠);j++<c;)p(╦,╩,╬);}
- [Try it online!][TIO-kssrhvra]
- [C (gcc)]: https://gcc.gnu.org/
- [TIO-kssrhvra]: https://tio.run/##HYrfCoIwGMXvfYrBbvaxeSF0EU7xRUSQ5eSTWmJB/sG3SIIgCIIg6Kl8kNb04pwf/M5RfqmUtXRXaDQFqVkrOtEDqRs0Z80wCxLMVEL7kHYhbcFDUUnNFAz62DCMA4lRrGTN5umWGjFPj7VfqQGBnMPyquJlvjp9d3mCrDiPlITFvp35uHxBjvaQo2EweIRotgG5cus42p/S@7w8Wf/yBw "C (gcc) – Try It Online"
- Function solution.
I started with a recursive solution but it didn't work out well... though I'm still convinced that this can be shaved down quite a bit with recursion.
- # [C (gcc)], <strike>119 118 116</strike> 115 bytes
- <!-- language-all: lang-c -->
- #define p(x,y,z) printf(i^1?i^c?#z:#y:#x)
- i,j;f(c){for(i=1;i<=c;p(╗\n,╝\n,╣\n),i++)for(j=p(╔,╚,╠);j++<c;)p(╦,╩,╬);}
- [Try it online!][TIO-kssrhvra]
- [C (gcc)]: https://gcc.gnu.org/
- [TIO-kssrhvra]: https://tio.run/##HYrfCoIwGMXvfYrBbvaxeSF0EU7xRUSQ5eSTWmJB/sG3SIIgCIIg6Kl8kNb04pwf/M5RfqmUtXRXaDQFqVkrOtEDqRs0Z80wCxLMVEL7kHYhbcFDUUnNFAz62DCMA4lRrGTN5umWGjFPj7VfqQGBnMPyquJlvjp9d3mCrDiPlITFvp35uHxBjvaQo2EweIRotgG5cus42p/S@7w8Wf/yBw "C (gcc) – Try It Online"
- Function solution.
- I started with a recursive solution but it didn't work out well... though I'm still convinced that this can be shaved down quite a bit with recursion.
- EDIT:
- Recursive version which currently landed at exactly 115 bytes too...
- #define p(x,y,z) printf(i^1?i^c?#z:#x:#y);
- c,j;f(i){for(c=c?c:i,j=p(╔,╚,╠)j++<c;)p(╦,╩,╬)p(╗\n,╝\n,╣\n)--i?f(i):0;}
#10: Post edited
# [C (gcc)], <strike>119 118</strike> 116 bytes- <!-- language-all: lang-c -->
- #define p(x,y,z) printf(i^1?i^c?#z:#y:#x)
i,j;f(c){for(i=1;i<=c;p(╗,╝,╣),i++)for(j=p(╔,╚,╠);j<c;j++)p(╦,╩,╬);}[Try it online!][TIO-kssrd7un]- [C (gcc)]: https://gcc.gnu.org/
[TIO-kssrd7un]: https://tio.run/##HYrfCoIwGMXvfYrBbvbhvBC6CKf4IiLIcvKNWmJB/sG3SIIgCIIg6Kl8kNb04pwf/M6RQSWltXRXKjQlqVnLO94DqRs0Z8UwD1PMZUr7iHYRbcFDroViEgZ1bBgmocA4kaJm83TLDJ@nx9qvzABH34flpZNlvjp9d3mC0LEU2o2Lfjv1cfmCGO2hQMNg8AhRbANi5dZxtD@p9kV1ssHlDw "C (gcc) – Try It Online"- Function solution.
- I started with a recursive solution but it didn't work out well... though I'm still convinced that this can be shaved down quite a bit with recursion.
- # [C (gcc)], <strike>119 118 116</strike> 115 bytes
- <!-- language-all: lang-c -->
- #define p(x,y,z) printf(i^1?i^c?#z:#y:#x)
- i,j;f(c){for(i=1;i<=c;p(╗
- ,╝
- ,╣
- ),i++)for(j=p(╔,╚,╠);j++<c;)p(╦,╩,╬);}
- [Try it online!][TIO-kssrhvra]
- [C (gcc)]: https://gcc.gnu.org/
- [TIO-kssrhvra]: https://tio.run/##HYrfCoIwGMXvfYrBbvaxeSF0EU7xRUSQ5eSTWmJB/sG3SIIgCIIg6Kl8kNb04pwf/M5RfqmUtXRXaDQFqVkrOtEDqRs0Z80wCxLMVEL7kHYhbcFDUUnNFAz62DCMA4lRrGTN5umWGjFPj7VfqQGBnMPyquJlvjp9d3mCrDiPlITFvp35uHxBjvaQo2EweIRotgG5cus42p/S@7w8Wf/yBw "C (gcc) – Try It Online"
- Function solution.
- I started with a recursive solution but it didn't work out well... though I'm still convinced that this can be shaved down quite a bit with recursion.
#9: Post edited
# [C (gcc)], <strike>119</strike> 118 bytes- <!-- language-all: lang-c -->
- #define p(x,y,z) printf(i^1?i^c?#z:#y:#x)
i,j;f(c){for(i=1;i<=c;p(╗,╝,╣),i++)for(j=3,p(╔,╚,╠);j<c;j++)p(╦,╩,╬);}[Try it online!][TIO-kssr6wok]- [C (gcc)]: https://gcc.gnu.org/
[TIO-kssr6wok]: https://tio.run/##HYrfCoIwGMXvfYrBbvbhvJC6CJf4IiLIcvKNWmJB/sG3SIIgCIIg6Kl8kNb04pwfnN@RQSmltXRXKDQFqVjDW94BqWo0Z8UwCxPMZEK7iLYRbcBDroViEnp1rBnGocBtLEXFpvGWGj6Nj6VfqQGOvg/zS8crPh@uTtxdniD0Vgrt9Dy/3fRx@YIY7CFHw6D3CFFsDWLhxnGwP6n2eXmyweUP "C (gcc) – Try It Online"- Function solution.
- I started with a recursive solution but it didn't work out well... though I'm still convinced that this can be shaved down quite a bit with recursion.
- # [C (gcc)], <strike>119 118</strike> 116 bytes
- <!-- language-all: lang-c -->
- #define p(x,y,z) printf(i^1?i^c?#z:#y:#x)
- i,j;f(c){for(i=1;i<=c;p(╗
- ,╝
- ,╣
- ),i++)for(j=p(╔,╚,╠);j<c;j++)p(╦,╩,╬);}
- [Try it online!][TIO-kssrd7un]
- [C (gcc)]: https://gcc.gnu.org/
- [TIO-kssrd7un]: https://tio.run/##HYrfCoIwGMXvfYrBbvbhvBC6CKf4IiLIcvKNWmJB/sG3SIIgCIIg6Kl8kNb04pwf/M6RQSWltXRXKjQlqVnLO94DqRs0Z8UwD1PMZUr7iHYRbcFDroViEgZ1bBgmocA4kaJm83TLDJ@nx9qvzABH34flpZNlvjp9d3mC0LEU2o2Lfjv1cfmCGO2hQMNg8AhRbANi5dZxtD@p9kV1ssHlDw "C (gcc) – Try It Online"
- Function solution.
- I started with a recursive solution but it didn't work out well... though I'm still convinced that this can be shaved down quite a bit with recursion.
#8: Post edited
# [C (gcc)], 119 bytes- <!-- language-all: lang-c -->
- #define p(x,y,z) printf(i^1?i^c?#z:#y:#x)
i,j;f(c){for(i=1;i<=c&&p(╔,╚,╠);p(╗,╝,╣),i++)for(j=3;j<c;j++)p(╦,╩,╬);}[Try it online!][TIO-ksspc60b]- [C (gcc)]: https://gcc.gnu.org/
[TIO-ksspc60b]: https://tio.run/##HYtdCoJAFIXfXcXAgMzF8UHqIRzFjYggkyNXahIL8gd3kQRBEARB0KpcSNPYwzkfH5wj/VJKY@i2UKgLUrOWd7wHUjeoT4phFiSYyYT2Ie1C2oKDvBKKSRjUoWEYBwKjWLpuzebpwufpZvMAseg11Vbu/36mGjh6HiyvKl6JKpKisr4MX3bwtvmAGM0@R81gcAhRbA3iz43laL5S7fLyaPzzDw "C (gcc) – Try It Online"- Function solution.
- I started with a recursive solution but it didn't work out well... though I'm still convinced that this can be shaved down quite a bit with recursion.
- # [C (gcc)], <strike>119</strike> 118 bytes
- <!-- language-all: lang-c -->
- #define p(x,y,z) printf(i^1?i^c?#z:#y:#x)
- i,j;f(c){for(i=1;i<=c;p(╗
- ,╝
- ,╣
- ),i++)for(j=3,p(╔,╚,╠);j<c;j++)p(╦,╩,╬);}
- [Try it online!][TIO-kssr6wok]
- [C (gcc)]: https://gcc.gnu.org/
- [TIO-kssr6wok]: https://tio.run/##HYrfCoIwGMXvfYrBbvbhvJC6CJf4IiLIcvKNWmJB/sG3SIIgCIIg6Kl8kNb04pwfnN@RQSmltXRXKDQFqVjDW94BqWo0Z8UwCxPMZEK7iLYRbcBDroViEnp1rBnGocBtLEXFpvGWGj6Nj6VfqQGOvg/zS8crPh@uTtxdniD0Vgrt9Dy/3fRx@YIY7CFHw6D3CFFsDWLhxnGwP6n2eXmyweUP "C (gcc) – Try It Online"
- Function solution.
- I started with a recursive solution but it didn't work out well... though I'm still convinced that this can be shaved down quite a bit with recursion.
#7: Post edited
# [C (gcc)], <strike>126</strike> 124 bytes- <!-- language-all: lang-c -->
#define p(x,y,z) printf("%s",i^1?i^c?#z:#y:#x)- i,j;f(c){for(i=1;i<=c&&p(╔,╚,╠);p(╗\n,╝\n,╣\n),i++)for(j=3;j<c;j++)p(╦,╩,╬);}
[Try it online!][TIO-kssp9e7b]- [C (gcc)]: https://gcc.gnu.org/
[TIO-kssp9e7b]: https://tio.run/##HYtdCoJAFIXfXYUkyVwcH6QewlHciAgyOXKlJtEgf3AXSRAEQRAErcqFNI0@nPPxwTnczTlXytpnAmVmlqShLe3ALCuUZ0FW63pFMfEiTHhkdb7V@lYDBtKCCcKhF6eKYOgxDEJu2yWZxiudxrvOE9ist1hqeSz9iiVQdByYX0W4YUXAWaF9Hr714KPzBTaoY4qSQG@YpiBbYAt3moP6cXFI81q5lz8 "C (gcc) – Try It Online"- Function solution.
- I started with a recursive solution but it didn't work out well... though I'm still convinced that this can be shaved down quite a bit with recursion.
- # [C (gcc)], 119 bytes
- <!-- language-all: lang-c -->
- #define p(x,y,z) printf(i^1?i^c?#z:#y:#x)
- i,j;f(c){for(i=1;i<=c&&p(╔,╚,╠);p(╗\n,╝\n,╣\n),i++)for(j=3;j<c;j++)p(╦,╩,╬);}
- [Try it online!][TIO-ksspc60b]
- [C (gcc)]: https://gcc.gnu.org/
- [TIO-ksspc60b]: https://tio.run/##HYtdCoJAFIXfXcXAgMzF8UHqIRzFjYggkyNXahIL8gd3kQRBEARB0KpcSNPYwzkfH5wj/VJKY@i2UKgLUrOWd7wHUjeoT4phFiSYyYT2Ie1C2oKDvBKKSRjUoWEYBwKjWLpuzebpwufpZvMAseg11Vbu/36mGjh6HiyvKl6JKpKisr4MX3bwtvmAGM0@R81gcAhRbA3iz43laL5S7fLyaPzzDw "C (gcc) – Try It Online"
- Function solution.
- I started with a recursive solution but it didn't work out well... though I'm still convinced that this can be shaved down quite a bit with recursion.
#6: Post edited
# [C (gcc)], 124 bytes- <!-- language-all: lang-c -->
- #define p(x,y,z) printf("%s",i^1?i^c?#z:#y:#x)
- i,j;f(c){for(i=1;i<=c&&p(╔,╚,╠);p(╗\n,╝\n,╣\n),i++)for(j=3;j<c;j++)p(╦,╩,╬);}
- [Try it online!][TIO-kssp9e7b]
- [C (gcc)]: https://gcc.gnu.org/
- [TIO-kssp9e7b]: https://tio.run/##HYtdCoJAFIXfXYUkyVwcH6QewlHciAgyOXKlJtEgf3AXSRAEQRAErcqFNI0@nPPxwTnczTlXytpnAmVmlqShLe3ALCuUZ0FW63pFMfEiTHhkdb7V@lYDBtKCCcKhF6eKYOgxDEJu2yWZxiudxrvOE9ist1hqeSz9iiVQdByYX0W4YUXAWaF9Hr714KPzBTaoY4qSQG@YpiBbYAt3moP6cXFI81q5lz8 "C (gcc) – Try It Online"
- Function solution.
- I started with a recursive solution but it didn't work out well... though I'm still convinced that this can be shaved down quite a bit with recursion.
- # [C (gcc)], <strike>126</strike> 124 bytes
- <!-- language-all: lang-c -->
- #define p(x,y,z) printf("%s",i^1?i^c?#z:#y:#x)
- i,j;f(c){for(i=1;i<=c&&p(╔,╚,╠);p(╗\n,╝\n,╣\n),i++)for(j=3;j<c;j++)p(╦,╩,╬);}
- [Try it online!][TIO-kssp9e7b]
- [C (gcc)]: https://gcc.gnu.org/
- [TIO-kssp9e7b]: https://tio.run/##HYtdCoJAFIXfXYUkyVwcH6QewlHciAgyOXKlJtEgf3AXSRAEQRAErcqFNI0@nPPxwTnczTlXytpnAmVmlqShLe3ALCuUZ0FW63pFMfEiTHhkdb7V@lYDBtKCCcKhF6eKYOgxDEJu2yWZxiudxrvOE9ist1hqeSz9iiVQdByYX0W4YUXAWaF9Hr714KPzBTaoY4qSQG@YpiBbYAt3moP6cXFI81q5lz8 "C (gcc) – Try It Online"
- Function solution.
- I started with a recursive solution but it didn't work out well... though I'm still convinced that this can be shaved down quite a bit with recursion.
#5: Post edited
# [C (gcc)], 124 bytes <strike>126</strike>- <!-- language-all: lang-c -->
- #define p(x,y,z) printf("%s",i^1?i^c?#z:#y:#x)
- i,j;f(c){for(i=1;i<=c&&p(╔,╚,╠);p(╗\n,╝\n,╣\n),i++)for(j=3;j<c;j++)p(╦,╩,╬);}
- [Try it online!][TIO-kssp9e7b]
- [C (gcc)]: https://gcc.gnu.org/
- [TIO-kssp9e7b]: https://tio.run/##HYtdCoJAFIXfXYUkyVwcH6QewlHciAgyOXKlJtEgf3AXSRAEQRAErcqFNI0@nPPxwTnczTlXytpnAmVmlqShLe3ALCuUZ0FW63pFMfEiTHhkdb7V@lYDBtKCCcKhF6eKYOgxDEJu2yWZxiudxrvOE9ist1hqeSz9iiVQdByYX0W4YUXAWaF9Hr714KPzBTaoY4qSQG@YpiBbYAt3moP6cXFI81q5lz8 "C (gcc) – Try It Online"
- Function solution.
- I started with a recursive solution but it didn't work out well... though I'm still convinced that this can be shaved down quite a bit with recursion.
- # [C (gcc)], 124 bytes
- <!-- language-all: lang-c -->
- #define p(x,y,z) printf("%s",i^1?i^c?#z:#y:#x)
- i,j;f(c){for(i=1;i<=c&&p(╔,╚,╠);p(╗\n,╝\n,╣\n),i++)for(j=3;j<c;j++)p(╦,╩,╬);}
- [Try it online!][TIO-kssp9e7b]
- [C (gcc)]: https://gcc.gnu.org/
- [TIO-kssp9e7b]: https://tio.run/##HYtdCoJAFIXfXYUkyVwcH6QewlHciAgyOXKlJtEgf3AXSRAEQRAErcqFNI0@nPPxwTnczTlXytpnAmVmlqShLe3ALCuUZ0FW63pFMfEiTHhkdb7V@lYDBtKCCcKhF6eKYOgxDEJu2yWZxiudxrvOE9ist1hqeSz9iiVQdByYX0W4YUXAWaF9Hr714KPzBTaoY4qSQG@YpiBbYAt3moP6cXFI81q5lz8 "C (gcc) – Try It Online"
- Function solution.
- I started with a recursive solution but it didn't work out well... though I'm still convinced that this can be shaved down quite a bit with recursion.
#4: Post edited
# [C (gcc)], 124 bytes- <!-- language-all: lang-c -->
- #define p(x,y,z) printf("%s",i^1?i^c?#z:#y:#x)
- i,j;f(c){for(i=1;i<=c&&p(╔,╚,╠);p(╗\n,╝\n,╣\n),i++)for(j=3;j<c;j++)p(╦,╩,╬);}
- [Try it online!][TIO-kssp9e7b]
- [C (gcc)]: https://gcc.gnu.org/
- [TIO-kssp9e7b]: https://tio.run/##HYtdCoJAFIXfXYUkyVwcH6QewlHciAgyOXKlJtEgf3AXSRAEQRAErcqFNI0@nPPxwTnczTlXytpnAmVmlqShLe3ALCuUZ0FW63pFMfEiTHhkdb7V@lYDBtKCCcKhF6eKYOgxDEJu2yWZxiudxrvOE9ist1hqeSz9iiVQdByYX0W4YUXAWaF9Hr714KPzBTaoY4qSQG@YpiBbYAt3moP6cXFI81q5lz8 "C (gcc) – Try It Online"
- Function solution.
- I started with a recursive solution but it didn't work out well... though I'm still convinced that this can be shaved down quite a bit with recursion.
- # [C (gcc)], 124 bytes <strike>126</strike>
- <!-- language-all: lang-c -->
- #define p(x,y,z) printf("%s",i^1?i^c?#z:#y:#x)
- i,j;f(c){for(i=1;i<=c&&p(╔,╚,╠);p(╗\n,╝\n,╣\n),i++)for(j=3;j<c;j++)p(╦,╩,╬);}
- [Try it online!][TIO-kssp9e7b]
- [C (gcc)]: https://gcc.gnu.org/
- [TIO-kssp9e7b]: https://tio.run/##HYtdCoJAFIXfXYUkyVwcH6QewlHciAgyOXKlJtEgf3AXSRAEQRAErcqFNI0@nPPxwTnczTlXytpnAmVmlqShLe3ALCuUZ0FW63pFMfEiTHhkdb7V@lYDBtKCCcKhF6eKYOgxDEJu2yWZxiudxrvOE9ist1hqeSz9iiVQdByYX0W4YUXAWaF9Hr714KPzBTaoY4qSQG@YpiBbYAt3moP6cXFI81q5lz8 "C (gcc) – Try It Online"
- Function solution.
- I started with a recursive solution but it didn't work out well... though I'm still convinced that this can be shaved down quite a bit with recursion.
#3: Post edited
# [C (gcc)], 124 <strike>126</strike> bytes- <!-- language-all: lang-c -->
- #define p(x,y,z) printf("%s",i^1?i^c?#z:#y:#x)
- i,j;f(c){for(i=1;i<=c&&p(╔,╚,╠);p(╗\n,╝\n,╣\n),i++)for(j=3;j<c;j++)p(╦,╩,╬);}
- [Try it online!][TIO-kssp9e7b]
- [C (gcc)]: https://gcc.gnu.org/
- [TIO-kssp9e7b]: https://tio.run/##HYtdCoJAFIXfXYUkyVwcH6QewlHciAgyOXKlJtEgf3AXSRAEQRAErcqFNI0@nPPxwTnczTlXytpnAmVmlqShLe3ALCuUZ0FW63pFMfEiTHhkdb7V@lYDBtKCCcKhF6eKYOgxDEJu2yWZxiudxrvOE9ist1hqeSz9iiVQdByYX0W4YUXAWaF9Hr714KPzBTaoY4qSQG@YpiBbYAt3moP6cXFI81q5lz8 "C (gcc) – Try It Online"
- Function solution.
- I started with a recursive solution but it didn't work out well... though I'm still convinced that this can be shaved down quite a bit with recursion.
- # [C (gcc)], 124 bytes
- <!-- language-all: lang-c -->
- #define p(x,y,z) printf("%s",i^1?i^c?#z:#y:#x)
- i,j;f(c){for(i=1;i<=c&&p(╔,╚,╠);p(╗\n,╝\n,╣\n),i++)for(j=3;j<c;j++)p(╦,╩,╬);}
- [Try it online!][TIO-kssp9e7b]
- [C (gcc)]: https://gcc.gnu.org/
- [TIO-kssp9e7b]: https://tio.run/##HYtdCoJAFIXfXYUkyVwcH6QewlHciAgyOXKlJtEgf3AXSRAEQRAErcqFNI0@nPPxwTnczTlXytpnAmVmlqShLe3ALCuUZ0FW63pFMfEiTHhkdb7V@lYDBtKCCcKhF6eKYOgxDEJu2yWZxiudxrvOE9ist1hqeSz9iiVQdByYX0W4YUXAWaF9Hr714KPzBTaoY4qSQG@YpiBbYAt3moP6cXFI81q5lz8 "C (gcc) – Try It Online"
- Function solution.
- I started with a recursive solution but it didn't work out well... though I'm still convinced that this can be shaved down quite a bit with recursion.
#2: Post edited
# [C (gcc)], 126 bytes- <!-- language-all: lang-c -->
- #define p(x,y,z) printf("%s",i^1?i^c?#z:#y:#x)
i,j;f(c){for(i=1;i<=c&&p(╔,╚,╠);p(╗,╝,╣),i++)for(j=0;j<c-3;j++)p(╦,╩,╬);}[Try it online!][TIO-ksson86j]- [C (gcc)]: https://gcc.gnu.org/
[TIO-ksson86j]: https://tio.run/##HYtRCoJAGITfO8XiUuyPKyT1EK7SRUSIzZV/qU0qSBNvUQRBEARB0Kk8SNvqw8zwDTMyKKS0lq5zhSYnJat4zc9Ayj2ao2Le@OBxzMIlZnJJzxGtI1rBCLkWiklo1G7PMAkFxomcTErWXS@8u96dniB6vKXGwWPwV2qAo@9D/9LJVOhYBjOhXdNP327ycfqCaO12hYZBMyJEsTmIIRcuW/uTarMqDjY4/QE "C (gcc) – Try It Online"- Function solution.
- I started with a recursive solution but it didn't work out well... though I'm still convinced that this can be shaved down quite a bit with recursion.
- # [C (gcc)], 124 <strike>126</strike> bytes
- <!-- language-all: lang-c -->
- #define p(x,y,z) printf("%s",i^1?i^c?#z:#y:#x)
- i,j;f(c){for(i=1;i<=c&&p(╔,╚,╠);p(╗
- ,╝
- ,╣
- ),i++)for(j=3;j<c;j++)p(╦,╩,╬);}
- [Try it online!][TIO-kssp9e7b]
- [C (gcc)]: https://gcc.gnu.org/
- [TIO-kssp9e7b]: https://tio.run/##HYtdCoJAFIXfXYUkyVwcH6QewlHciAgyOXKlJtEgf3AXSRAEQRAErcqFNI0@nPPxwTnczTlXytpnAmVmlqShLe3ALCuUZ0FW63pFMfEiTHhkdb7V@lYDBtKCCcKhF6eKYOgxDEJu2yWZxiudxrvOE9ist1hqeSz9iiVQdByYX0W4YUXAWaF9Hr714KPzBTaoY4qSQG@YpiBbYAt3moP6cXFI81q5lz8 "C (gcc) – Try It Online"
- Function solution.
- I started with a recursive solution but it didn't work out well... though I'm still convinced that this can be shaved down quite a bit with recursion.
#1: Initial revision
# [C (gcc)], 126 bytes <!-- language-all: lang-c --> #define p(x,y,z) printf("%s",i^1?i^c?#z:#y:#x) i,j;f(c){for(i=1;i<=c&&p(╔,╚,╠);p(╗\n,╝\n,╣\n),i++)for(j=0;j<c-3;j++)p(╦,╩,╬);} [Try it online!][TIO-ksson86j] [C (gcc)]: https://gcc.gnu.org/ [TIO-ksson86j]: https://tio.run/##HYtRCoJAGITfO8XiUuyPKyT1EK7SRUSIzZV/qU0qSBNvUQRBEARB0Kk8SNvqw8zwDTMyKKS0lq5zhSYnJat4zc9Ayj2ao2Le@OBxzMIlZnJJzxGtI1rBCLkWiklo1G7PMAkFxomcTErWXS@8u96dniB6vKXGwWPwV2qAo@9D/9LJVOhYBjOhXdNP327ycfqCaO12hYZBMyJEsTmIIRcuW/uTarMqDjY4/QE "C (gcc) – Try It Online" Function solution. I started with a recursive solution but it didn't work out well... though I'm still convinced that this can be shaved down quite a bit with recursion.