Skip to main content
deleted 2 characters in body
Source Link

C 98, 120118 bytes

Ive edited this now to instead of echoing F or T it will return 0 or 1 to the pipe.

int i,j,k;int main(int,char**v){for(;i<7;(j+=(v[1][i]-'0'48)*(i++%2?1:3)));for(;(k+=10)<j;);return v[1][7]-'0'==48==(k-j)%10;} 

usage:

./a.out XXXXXXXX 

where XXXXXXXX is a zero padded string, it will return either a 0 or a 1 as an exit code

this is 120118 chars long in total. and the the compiled program is

 text data bss dec hex filename 1307 544 16 1867 74b a.out 

C 98, 120 bytes

Ive edited this now to instead of echoing F or T it will return 0 or 1 to the pipe.

int i,j,k;int main(int,char**v){for(;i<7;(j+=(v[1][i]-'0')*(i++%2?1:3)));for(;(k+=10)<j;);return v[1][7]-'0'==(k-j)%10;} 

usage:

./a.out XXXXXXXX 

where XXXXXXXX is a zero padded string, it will return either a 0 or a 1 as an exit code

this is 120 chars long in total. and the the compiled program is

 text data bss dec hex filename 1307 544 16 1867 74b a.out 

C 98, 118 bytes

Ive edited this now to instead of echoing F or T it will return 0 or 1 to the pipe.

int i,j,k;int main(int,char**v){for(;i<7;(j+=(v[1][i]-48)*(i++%2?1:3)));for(;(k+=10)<j;);return v[1][7]-48==(k-j)%10;} 

usage:

./a.out XXXXXXXX 

where XXXXXXXX is a zero padded string, it will return either a 0 or a 1 as an exit code

this is 118 chars long in total. and the the compiled program is

 text data bss dec hex filename 1307 544 16 1867 74b a.out 
added 123 characters in body
Source Link

C 98, 155120 bytes

This is my first time Golfing so here goes;Ive edited this now to instead of echoing F or T it will return 0 or 1 to the pipe.

#include <stdio.h> int i,j,k;int main(int,char**v){for(;i<7;(j+=(v[1][i]-'0')*("31"[i++%2]-'0'i++%2?1:3))); for;for(;(k+=10)<j;);putchar("FT"[v[1][7];return v[1][7]-'0'==(k-j)%10]);%10;} 

usage:

./a.out XXXXXXXX 

where XXXXXXXX is a zero padded string, it will return either an Fa 0 or a T1 as an exit code

this is 155120 chars long in total the main.cpp file and the the compiled program is 4.0k

 text data bss dec hex filename 1307 544 16 1867 74b a.out 

C 98, 155 bytes

This is my first time Golfing so here goes;

#include <stdio.h> int i,j,k;int main(int,char**v){for(;i<7;(j+=(v[1][i]-'0')*("31"[i++%2]-'0'))); for(;(k+=10)<j;);putchar("FT"[v[1][7]-'0'==(k-j)%10]);} 

usage:

./a.out XXXXXXXX 

where XXXXXXXX is a zero padded string, it will return either an F or a T

this is 155 chars long in total the main.cpp file is 4.0k

C 98, 120 bytes

Ive edited this now to instead of echoing F or T it will return 0 or 1 to the pipe.

int i,j,k;int main(int,char**v){for(;i<7;(j+=(v[1][i]-'0')*(i++%2?1:3)));for(;(k+=10)<j;);return v[1][7]-'0'==(k-j)%10;} 

usage:

./a.out XXXXXXXX 

where XXXXXXXX is a zero padded string, it will return either a 0 or a 1 as an exit code

this is 120 chars long in total. and the the compiled program is

 text data bss dec hex filename 1307 544 16 1867 74b a.out 
added 11 characters in body
Source Link
Wheat Wizard
  • 102.9k
  • 23
  • 299
  • 697

C 98, 155 bytes

This is my first time Golfing so here goes;

#include <stdio.h> int i,j,k;int main(int,char**v){for(;i<7;(j+=(v[1][i]-'0')*("31"[i++%2]-'0'))); for(;(k+=10)<j;);putchar("FT"[v[1][7]-'0'==(k-j)%10]);} 

usage:

./a.out XXXXXXXX 

where XXXXXXXX is a zero padded string, it will return either an F or a T

this is 155 chars long in total the main.cpp file is 4.0k

C 98

This is my first time Golfing so here goes;

#include <stdio.h> int i,j,k;int main(int,char**v){for(;i<7;(j+=(v[1][i]-'0')*("31"[i++%2]-'0'))); for(;(k+=10)<j;);putchar("FT"[v[1][7]-'0'==(k-j)%10]);} 

usage:

./a.out XXXXXXXX 

where XXXXXXXX is a zero padded string, it will return either an F or a T

this is 155 chars long in total the main.cpp file is 4.0k

C 98, 155 bytes

This is my first time Golfing so here goes;

#include <stdio.h> int i,j,k;int main(int,char**v){for(;i<7;(j+=(v[1][i]-'0')*("31"[i++%2]-'0'))); for(;(k+=10)<j;);putchar("FT"[v[1][7]-'0'==(k-j)%10]);} 

usage:

./a.out XXXXXXXX 

where XXXXXXXX is a zero padded string, it will return either an F or a T

this is 155 chars long in total the main.cpp file is 4.0k

Source Link
Loading