Skip to main content
deleted 4 characters in body
Source Link
FryAmTheEggman
  • 17.5k
  • 3
  • 42
  • 99

C (gcc), 132 128128 109

i;m;x;y;fi;m;f(char*s){x=*s-64-(*s>73);y=atoi(s+1);forfor(i=380;i--;putchar(m?m==20m^84-x&&i*s+(*s>73)|(i/20+1==y20+1)^atoi(s+1)?79:m%6==4&&im%6^4|i/20%6==320%6^3?46:42:4679:10))m=i%20;} 

IdeoneIdeone

A function that prints the board to STDOUT. Requires the letter coordinate to be capital. Printing in one loop seems to be slightly shorter than the previous nested loop approach.

C (gcc), 132 128

i;m;x;y;f(char*s){x=*s-64-(*s>73);y=atoi(s+1);for(i=380;i--;putchar(m?m==20-x&&i/20+1==y?79:m%6==4&&i/20%6==3?42:46:10))m=i%20;} 

Ideone

A function that prints the board to STDOUT. Requires the letter coordinate to be capital. Printing in one loop seems to be slightly shorter than the previous nested loop approach.

C (gcc), 132 128 109

i;m;f(char*s){for(i=380;i--;putchar(m?m^84-*s+(*s>73)|(i/20+1)^atoi(s+1)?m%6^4|i/20%6^3?46:42:79:10))m=i%20;} 

Ideone

A function that prints the board to STDOUT. Requires the letter coordinate to be capital. Printing in one loop seems to be slightly shorter than the previous nested loop approach.

deleted 8 characters in body
Source Link
FryAmTheEggman
  • 17.5k
  • 3
  • 42
  • 99

C (gcc), 132132 128

i;j;x;y;fi;m;x;y;f(char*s){x=*s-64-(*s>73);y=atoi(s+1);for(i=19;i--;puts(""))for(j=19;ji=380;i--;putchar(x==19m?m==20-j&&y==i+1x&&i/20+1==y?79:j%6==3&&i%6==3m%6==4&&i/20%6==3?42:46:10));m=i%20;} 

IdeoneIdeone

A function that prints the board to STDOUT. Requires the letter coordinate to be capital. The conditionals can probably be golfed some more (?). I also haven't tried printing it outPrinting in one loop, yet seems to be slightly shorter than the previous nested loop approach.

C (gcc), 132

i;j;x;y;f(char*s){x=*s-64-(*s>73);y=atoi(s+1);for(i=19;i--;puts(""))for(j=19;j--;putchar(x==19-j&&y==i+1?79:j%6==3&&i%6==3?42:46));} 

Ideone

A function that prints the board to STDOUT. Requires the letter coordinate to be capital. The conditionals can probably be golfed some more (?). I also haven't tried printing it out in one loop, yet.

C (gcc), 132 128

i;m;x;y;f(char*s){x=*s-64-(*s>73);y=atoi(s+1);for(i=380;i--;putchar(m?m==20-x&&i/20+1==y?79:m%6==4&&i/20%6==3?42:46:10))m=i%20;} 

Ideone

A function that prints the board to STDOUT. Requires the letter coordinate to be capital. Printing in one loop seems to be slightly shorter than the previous nested loop approach.

deleted 8 characters in body
Source Link
FryAmTheEggman
  • 17.5k
  • 3
  • 42
  • 99

C (gcc), 140132

i;j;x;y;f(char*s){x=*s-64-(*s>73);y=atoi(s+1);for(i=19;i--;puts(""))for(j=19;j--;putchar((x==19-j)&&(y==i+1)j&&y==i+1?79:(j%6==3)&&(i%6==3)j%6==3&&i%6==3?42:46));} 

Ideone

A function that prints the board to STDOUT. Requires the letter coordinate to be capital. The conditionals can probably be golfed some more (?). I also haven't tried printing it out in one loop, yet.

C (gcc), 140

i;j;x;y;f(char*s){x=*s-64-(*s>73);y=atoi(s+1);for(i=19;i--;puts(""))for(j=19;j--;putchar((x==19-j)&&(y==i+1)?79:(j%6==3)&&(i%6==3)?42:46));} 

Ideone

A function that prints the board to STDOUT. Requires the letter coordinate to be capital. The conditionals can probably be golfed some more (?). I also haven't tried printing it out in one loop, yet.

C (gcc), 132

i;j;x;y;f(char*s){x=*s-64-(*s>73);y=atoi(s+1);for(i=19;i--;puts(""))for(j=19;j--;putchar(x==19-j&&y==i+1?79:j%6==3&&i%6==3?42:46));} 

Ideone

A function that prints the board to STDOUT. Requires the letter coordinate to be capital. The conditionals can probably be golfed some more (?). I also haven't tried printing it out in one loop, yet.

Source Link
FryAmTheEggman
  • 17.5k
  • 3
  • 42
  • 99
Loading