Skip to main content
-15 bytes now
Source Link

C (gcc), 252 242 269 262 241 235235 220 bytes

I was on stack overflow for sockets in python, when this popped up, said why not? first code golf, so i'm not entirely sure if I followed the rules 100% (and if not and someone wants to steal my proverbial cookie and fix it, so be it). With 'o' and ' ', 255 245 272 265 244 238 238228 bytes. replace +48 with *79+32.

#define Q(P,R)(R>>P&1)+48
char a[12];i=0;fa[11];i=0;f(char*c){char b=c[0];a[3]=a[7]=a[11]='\n';a[5]=Qb=c[0];a[3]=a[7]='\n';a[5]=Q(0,b);a[1]=a[9]=Q(3,b);a[2]=a[8]=Q(2,b)|a[1];a[0]=a[10]=Q(1,b)|a[2];a[4]=a[6]=a[1]|(Q|a[2];a[4]=a[6]=a[1]|Q(2,b)&Q(1,b));printf;puts(a);if(i++<1){printfputs(""---\n"");f(c+1);}}
 

Try it online!Try it online!

How it works:
I use a bit shift and bitwise and to find if a spot should be clear or a pip, then offset the 0 or 1 to the correct ASCII value. it messes up on 4 and 5, so they needed some fixing. actually added a few bytes. was able to remove several bytes by removing a mask and just using 1 (doh)

Special thanks to Mr. Xcoder for the 7 less bytes by removing an excess #define
Changes: removed memset -21 bytes. redid the bit logic for 6, 4, 2 to depend on 8|4&2, 8|4, 8|4|2, respectively. -6 bytes. removed extra newlines by using puts instead of printf, which is also shorter. shortened the array to 11, removing extra assignment. -15 bytes. NOW I think that's the best I can do.

C (gcc), 252 242 269 262 241 235 bytes

I was on stack overflow for sockets in python, when this popped up, said why not? first code golf, so i'm not entirely sure if I followed the rules 100% (and if not and someone wants to steal my proverbial cookie and fix it, so be it). With 'o' and ' ', 255 245 272 265 244 238 bytes. replace +48 with *79+32.

#define Q(P,R)(R>>P&1)+48
char a[12];i=0;f(char*c){char b=c[0];a[3]=a[7]=a[11]='\n';a[5]=Q(0,b);a[1]=a[9]=Q(3,b);a[2]=a[8]=Q(2,b)|a[1];a[0]=a[10]=Q(1,b)|a[2];a[4]=a[6]=a[1]|(Q(2,b)&Q(1,b));printf(a);if(i++<1){printf("---\n");f(c+1);}}
 

Try it online!

How it works:
I use a bit shift and bitwise and to find if a spot should be clear or a pip, then offset the 0 or 1 to the correct ASCII value. it messes up on 4 and 5, so they needed some fixing. actually added a few bytes. was able to remove several bytes by removing a mask and just using 1 (doh)

Special thanks to Mr. Xcoder for the 7 less bytes by removing an excess #define
Changes: removed memset -21 bytes. redid the bit logic for 6, 4, 2 to depend on 8|4&2, 8|4, 8|4|2, respectively. -6 bytes. I think that's the best I can do.

C (gcc), 252 242 269 262 241 235 220 bytes

I was on stack overflow for sockets in python, when this popped up, said why not? first code golf, so i'm not entirely sure if I followed the rules 100% (and if not and someone wants to steal my proverbial cookie and fix it, so be it). With 'o' and ' ', 255 245 272 265 244 238 228 bytes. replace +48 with *79+32.

#define Q(P,R)(R>>P&1)+48
char a[11];i=0;f(char*c){char b=c[0];a[3]=a[7]='\n';a[5]=Q(0,b);a[1]=a[9]=Q(3,b);a[2]=a[8]=Q(2,b)|a[1];a[0]=a[10]=Q(1,b)|a[2];a[4]=a[6]=a[1]|Q(2,b)&Q(1,b);puts(a);if(i++<1){puts("---");f(c+1);}}

Try it online!

How it works:
I use a bit shift and bitwise and to find if a spot should be clear or a pip, then offset the 0 or 1 to the correct ASCII value. it messes up on 4 and 5, so they needed some fixing. actually added a few bytes. was able to remove several bytes by removing a mask and just using 1 (doh)

Special thanks to Mr. Xcoder for the 7 less bytes by removing an excess #define
Changes: removed memset -21 bytes. redid the bit logic for 6, 4, 2 to depend on 8|4&2, 8|4, 8|4|2, respectively. -6 bytes. removed extra newlines by using puts instead of printf, which is also shorter. shortened the array to 11, removing extra assignment. -15 bytes. NOW I think that's the best I can do.

deleted 28 characters in body
Source Link
user202729
  • 17.4k
  • 2
  • 37
  • 70

C (gcc), 252 bytes 242 bytes 269 bytes 262 bytes 241 bytes 235 bytes

I was on stack overflow for sockets in python, when this popped up, said why not? first code golf, so i'm not entirely sure if I followed the rules 100% (and if not and someone wants to steal my proverbial cookie and fix it, so be it). With 'o' and ' ', 255 245 272 265 244 238 bytes. replace +48 with *79+32.

#define Q(P,R)(R>>P&1)+48
char a[12];i=0;f(char*c){char b=c[0];a[3]=a[7]=a[11]='\n';a[5]=Q(0,b);a[1]=a[9]=Q(3,b);a[2]=a[8]=Q(2,b)|a[1];a[0]=a[10]=Q(1,b)|a[2];a[4]=a[6]=a[1]|(Q(2,b)&Q(1,b));printf(a);if(i++<1){printf("---\n");f(c+1);}}

Try it online!

How it works:
I use a bit shift and bitwise and to find if a spot should be clear or a pip, then offset the 0 or 1 to the correct ASCII value. it messes up on 4 and 5, so they needed some fixing. actually added a few bytes. was able to remove several bytes by removing a mask and just using 1 (doh)

Special thanks to Mr. Xcoder for the 7 less bytes by removing an excess #define
Changes: removed memset -21 bytes. redid the bit logic for 6, 4, 2 to depend on 8|4&2, 8|4, 8|4|2, respectively. -6 bytes. I think that's the best I can do.

C (gcc), 252 bytes 242 bytes 269 bytes 262 bytes 241 bytes 235 bytes

I was on stack overflow for sockets in python, when this popped up, said why not? first code golf, so i'm not entirely sure if I followed the rules 100% (and if not and someone wants to steal my proverbial cookie and fix it, so be it). With 'o' and ' ', 255 245 272 265 244 238 bytes. replace +48 with *79+32.

#define Q(P,R)(R>>P&1)+48
char a[12];i=0;f(char*c){char b=c[0];a[3]=a[7]=a[11]='\n';a[5]=Q(0,b);a[1]=a[9]=Q(3,b);a[2]=a[8]=Q(2,b)|a[1];a[0]=a[10]=Q(1,b)|a[2];a[4]=a[6]=a[1]|(Q(2,b)&Q(1,b));printf(a);if(i++<1){printf("---\n");f(c+1);}}

Try it online!

How it works:
I use a bit shift and bitwise and to find if a spot should be clear or a pip, then offset the 0 or 1 to the correct ASCII value. it messes up on 4 and 5, so they needed some fixing. actually added a few bytes. was able to remove several bytes by removing a mask and just using 1 (doh)

Special thanks to Mr. Xcoder for the 7 less bytes by removing an excess #define
Changes: removed memset -21 bytes. redid the bit logic for 6, 4, 2 to depend on 8|4&2, 8|4, 8|4|2, respectively. -6 bytes. I think that's the best I can do.

C (gcc), 252 242 269 262 241 235 bytes

I was on stack overflow for sockets in python, when this popped up, said why not? first code golf, so i'm not entirely sure if I followed the rules 100% (and if not and someone wants to steal my proverbial cookie and fix it, so be it). With 'o' and ' ', 255 245 272 265 244 238 bytes. replace +48 with *79+32.

#define Q(P,R)(R>>P&1)+48
char a[12];i=0;f(char*c){char b=c[0];a[3]=a[7]=a[11]='\n';a[5]=Q(0,b);a[1]=a[9]=Q(3,b);a[2]=a[8]=Q(2,b)|a[1];a[0]=a[10]=Q(1,b)|a[2];a[4]=a[6]=a[1]|(Q(2,b)&Q(1,b));printf(a);if(i++<1){printf("---\n");f(c+1);}}

Try it online!

How it works:
I use a bit shift and bitwise and to find if a spot should be clear or a pip, then offset the 0 or 1 to the correct ASCII value. it messes up on 4 and 5, so they needed some fixing. actually added a few bytes. was able to remove several bytes by removing a mask and just using 1 (doh)

Special thanks to Mr. Xcoder for the 7 less bytes by removing an excess #define
Changes: removed memset -21 bytes. redid the bit logic for 6, 4, 2 to depend on 8|4&2, 8|4, 8|4|2, respectively. -6 bytes. I think that's the best I can do.

cleaned up solution to remove 6 additional bytes
Source Link

C (gcc), 252 bytes 242 bytes 269 bytes 262 bytes 241241 bytes 235 bytes

I was on stack overflow for sockets in python, when this popped up, said why not? first code golf, so i'm not entirely sure if I followed the rules 100% (and if not and someone wants to steal my proverbial cookie and fix it, so be it). With 'o' and ' ', 255 245 272 265 262244 244238 bytes. replace +48 with *79+32. had to reorder some bits to get 4 and 5 to work (oops)

#define Q(P,R)(R>>P&1)+48
char a[12];i=0;f(char*c){char b=c[0];a[3]=a[7]=a[11]='\n';a[5]=Q(0,b);a[1]=a[9]=Q(3,b);a[2]=a[8]=Q(2,b)|a[1];a[0]=Q|a[1];a[0]=a[10]=Q(1,b);a[4]=a[6]=a[1]||a[2];a[4]=a[6]=a[1]|(a[2]&a[0]Q(2,b);a[0]=a[10]=a[2]|a[0];printf&Q(1,b));printf(a);if(i++<1){printf("---\n");f(c+1);}}

Try it online!Try it online!

How it works:
I use a bit shift and bitwise and to find if a spot should be clear or a pip, then offset the 0 or 1 to the correct ASCII value. it messes up on 4 and 5, so they needed some fixing. actually added a few bytes. was able to remove several bytes by removing a mask and just using 1 (doh)

Special thanks to Mr. Xcoder for the 7 less bytes by removing an excess #define 
latest updateChanges: removed memset -21 bytes. redid the bit logic for 6, it was never used4, 2 to depend on 8|4&2, 8|4, 8|4|2, respectively. this is addicting-6 bytes. I think that's the best I can do.

C (gcc), 252 bytes 242 bytes 269 bytes 262 bytes 241 bytes

I was on stack overflow for sockets in python, when this popped up, said why not? first code golf, so i'm not entirely sure if I followed the rules 100% (and if not and someone wants to steal my proverbial cookie and fix it, so be it). With 'o' and ' ', 255 245 272 265 262 244 bytes. replace +48 with *79+32. had to reorder some bits to get 4 and 5 to work (oops)

#define Q(P,R)(R>>P&1)+48
char a[12];i=0;f(char*c){char b=c[0];a[3]=a[7]=a[11]='\n';a[5]=Q(0,b);a[1]=a[9]=Q(3,b);a[2]=a[8]=Q(2,b)|a[1];a[0]=Q(1,b);a[4]=a[6]=a[1]|(a[2]&a[0]);a[0]=a[10]=a[2]|a[0];printf(a);if(i++<1){printf("---\n");f(c+1);}}

Try it online!

How it works:
I use a bit shift and bitwise and to find if a spot should be clear or a pip, then offset the 0 or 1 to the correct ASCII value. it messes up on 4 and 5, so they needed some fixing. actually added a few bytes. was able to remove several bytes by removing a mask and just using 1 (doh)

Special thanks to Mr. Xcoder for the 7 less bytes by removing an excess #define latest update: removed memset, it was never used. this is addicting.

C (gcc), 252 bytes 242 bytes 269 bytes 262 bytes 241 bytes 235 bytes

I was on stack overflow for sockets in python, when this popped up, said why not? first code golf, so i'm not entirely sure if I followed the rules 100% (and if not and someone wants to steal my proverbial cookie and fix it, so be it). With 'o' and ' ', 255 245 272 265 244 238 bytes. replace +48 with *79+32.

#define Q(P,R)(R>>P&1)+48
char a[12];i=0;f(char*c){char b=c[0];a[3]=a[7]=a[11]='\n';a[5]=Q(0,b);a[1]=a[9]=Q(3,b);a[2]=a[8]=Q(2,b)|a[1];a[0]=a[10]=Q(1,b)|a[2];a[4]=a[6]=a[1]|(Q(2,b)&Q(1,b));printf(a);if(i++<1){printf("---\n");f(c+1);}}

Try it online!

How it works:
I use a bit shift and bitwise and to find if a spot should be clear or a pip, then offset the 0 or 1 to the correct ASCII value. it messes up on 4 and 5, so they needed some fixing. actually added a few bytes. was able to remove several bytes by removing a mask and just using 1 (doh)

Special thanks to Mr. Xcoder for the 7 less bytes by removing an excess #define 
Changes: removed memset -21 bytes. redid the bit logic for 6, 4, 2 to depend on 8|4&2, 8|4, 8|4|2, respectively. -6 bytes. I think that's the best I can do.

added 428 characters in body
Source Link
Loading
added 428 characters in body
Source Link
Loading
added 428 characters in body
Source Link
Loading
Source Link
Loading