Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Post History

50%
+0 −0
Challenges In The Jailhouse Now

C (clang), 210 198 183 bytes i,j,k,l;s(v,w,x,y,z){printf("%s",v);for(;w<x;w++){printf("%s",y);}puts(z);}main(){scanf("%i",&i);l=i-3;s("╔",j,l,"╦","╗");for(j=0;j<i-2;j++){s("╠",k,l,"╬",...

posted 3y ago by General Sebast1an‭  ·  edited 3y ago by General Sebast1an‭

Answer
#3: Post edited by user avatar General Sebast1an‭ · 2021-08-26T12:11:45Z (about 3 years ago)
  • # [C (clang)], <s>210</s> 198 bytes
  • <!-- language-all: lang-c -->
  • i,j,k,l;s(x,y,z){for(;x<y;x++){printf("%s",z);}}main(){scanf("%i",&i);printf("╔");l=i-3;s(j,l,"╦");puts("╗");for(j=0;j<i-2;j++){printf("╠");s(k,l,"╬");puts("╣");}printf("╚");s(j=0,l,"╩");puts("╝");}
  • [Try it online!][TIO-kss5rvrr]
  • Still wondering if these characters could even count as a byte, probably two. ¯\\\_(ツ)_/¯
  • A special golfing trick I learned. If you don't want to repeat the loops, then make a function. For some reason, [C (clang)] is okay with such non-returning function that's not `main()`. Enough abuse for this.
  • [C (clang)]: http://clang.llvm.org/
  • [TIO-kss5rvrr]: https://tio.run/##TY3hCoIwHMRfJRbFhjOi6NO0dxHN@s81xSlo4lskQRAEQRD0VL7I2pLIb8fd7@5CNxSB3OspyFCU0W7iqSKCdHHYaqCcJlQwhSta0xNp4jTHrPJqVjkOabIcZBFjNFPIhKxtjwFITBoVBtLagOgcCPthfXdGhAkf3LVZ5FRQYz2NlZWFsvHFaPvA/SXjHrgrxsc3fXc3gMLJ0HyPmg@j2z93/XJmZiBfI/JmSa03Hw "C (clang) – Try It Online"
  • # [C (clang)], <s>210</s> <s>198</s> 183 bytes
  • <!-- language-all: lang-c -->
  • i,j,k,l;s(v,w,x,y,z){printf("%s",v);for(;w<x;w++){printf("%s",y);}puts(z);}main(){scanf("%i",&i);l=i-3;s("╔",j,l,"╦","╗");for(j=0;j<i-2;j++){s("╠",k,l,"╬","╣");}s("╚",j=0,l,"╩","╝");}
  • [Try it online!][TIO-kssvwcx4]
  • Still wondering if these characters could even count as a byte, probably two. ¯\\\_(ツ)_/¯
  • A special golfing trick I learned. If you don't want to repeat the loops, then make a function. For some reason, [C (clang)] is okay with such non-returning function that's not `main()`. Enough abuse for this.
  • [C (clang)]: http://clang.llvm.org/
  • [TIO-kssvwcx4]: https://tio.run/##VY5dCoJAFIW3EhPFDF5Dip5G24to1rVpFMd/cRdFEARBEAStqo3YjD31cjnwfZxzAzsQvtwNU5SBKMLtxFV5iMlivxkQYjiA4IqWUEENDbSsSzOUeUTJTBEoGY@SjPLKrXllWf@wYbxPi1zRVoejj5KyTgW@NBgJzJFx4aG90vXkcz4RPSZApycx90J@3bHn8NhFe8ljMzC6d2LeMtZ7dB/a7Udy1S2e82Ovkd0MG4b1Fw "C (clang) – Try It Online"
#2: Post edited by user avatar General Sebast1an‭ · 2021-08-26T00:04:00Z (about 3 years ago)
  • # [C (clang)], 210 bytes
  • <!-- language-all: lang-c -->
  • i,j,k,l;main(){scanf("%i",&i);printf("╔");l=i-3;for(;j<l;j++){printf("╦");}puts("╗");for(j=0;j<i-2;j++){printf("╠");for(k=0;k<l;k++){printf("╬");}puts("╣");}printf("╚");for(j=0;j<l;j++){printf("╩");}puts("╝");}
  • [Try it online!][TIO-ksrcgdyq]
  • Still wondering if these characters could even count as a byte, probably two. ¯\\\_(ツ)_/¯
  • [C (clang)]: http://clang.llvm.org/
  • [TIO-ksrcgdyq]: https://tio.run/##S9ZNzknMS/@vnJmXnFOakqpgU1ySkpmvl2H3P1MnSydbJ8c6NzEzT0Ozujg5MS9NQ0k1U0lHLVPTuqAoM68EyH80dYqSpnWObaausXVafpGGdZZNjnWWtrZmNULFMqCK2oLSkmIQZzqQA1KYZWsAVJupa4SuegFUQTZQQTbQsGxU6TXIhi0Gc@Bys1DMxnDHSmStc0Gc//9NAA "C (clang) – Try It Online"
  • # [C (clang)], <s>210</s> 198 bytes
  • <!-- language-all: lang-c -->
  • i,j,k,l;s(x,y,z){for(;x<y;x++){printf("%s",z);}}main(){scanf("%i",&i);printf("╔");l=i-3;s(j,l,"╦");puts("╗");for(j=0;j<i-2;j++){printf("╠");s(k,l,"╬");puts("╣");}printf("╚");s(j=0,l,"╩");puts("╝");}
  • [Try it online!][TIO-kss5rvrr]
  • Still wondering if these characters could even count as a byte, probably two. ¯\\\_(ツ)_/¯
  • A special golfing trick I learned. If you don't want to repeat the loops, then make a function. For some reason, [C (clang)] is okay with such non-returning function that's not `main()`. Enough abuse for this.
  • [C (clang)]: http://clang.llvm.org/
  • [TIO-kss5rvrr]: https://tio.run/##TY3hCoIwHMRfJRbFhjOi6NO0dxHN@s81xSlo4lskQRAEQRD0VL7I2pLIb8fd7@5CNxSB3OspyFCU0W7iqSKCdHHYaqCcJlQwhSta0xNp4jTHrPJqVjkOabIcZBFjNFPIhKxtjwFITBoVBtLagOgcCPthfXdGhAkf3LVZ5FRQYz2NlZWFsvHFaPvA/SXjHrgrxsc3fXc3gMLJ0HyPmg@j2z93/XJmZiBfI/JmSa03Hw "C (clang) – Try It Online"
#1: Initial revision by user avatar General Sebast1an‭ · 2021-08-25T10:21:03Z (about 3 years ago)
# [C (clang)], 210 bytes

<!-- language-all: lang-c -->

    i,j,k,l;main(){scanf("%i",&i);printf("╔");l=i-3;for(;j<l;j++){printf("╦");}puts("╗");for(j=0;j<i-2;j++){printf("╠");for(k=0;k<l;k++){printf("╬");}puts("╣");}printf("╚");for(j=0;j<l;j++){printf("╩");}puts("╝");}

[Try it online!][TIO-ksrcgdyq]

Still wondering if these characters could even count as a byte, probably two. ¯\\\_(ツ)_/¯

[C (clang)]: http://clang.llvm.org/
[TIO-ksrcgdyq]: https://tio.run/##S9ZNzknMS/@vnJmXnFOakqpgU1ySkpmvl2H3P1MnSydbJ8c6NzEzT0Ozujg5MS9NQ0k1U0lHLVPTuqAoM68EyH80dYqSpnWObaausXVafpGGdZZNjnWWtrZmNULFMqCK2oLSkmIQZzqQA1KYZWsAVJupa4SuegFUQTZQQTbQsGxU6TXIhi0Gc@Bys1DMxnDHSmStc0Gc//9NAA "C (clang) – Try It Online"