Advertisement
theelitenoob

CrypTTTic

Oct 9th, 2013
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.90 KB | None | 0 0
  1. /**
  2. * For the brave souls who get this far: You are the chosen ones,
  3. * the valiant knights of programming who toil away, without rest,
  4. * fixing our most awful code. To you, true saviors, kings of men,
  5. * I say this: never gonna give you up, never gonna let you down,
  6. * never gonna run around and desert you. Never gonna make you cry,
  7. * never gonna say goodbye. Never gonna tell a lie and hurt you.
  8. **/
  9.  
  10. #include <time.h>
  11.  
  12. int _(); void ___(int(*________)(int* b, int c), int* b);
  13. void ______(int(*________)(int* b, int c), int* b); void __(int* b); int ____(int* b); int _____(int* b, int place);
  14. int main(){int a[] = {0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20}; __(a);while(____(a) == -1){___(_____, a);__(a);if(____(a) != -1)break;______(_____, a);__(a);if(____(a) != -1)break;}printf("%c wins!\n", ____(a));return 0;}
  15. void ______(int(*________)(int* b, int c), int* b){int _b_b_;srand(time(NULL));do{_b_b_ = (rand() % 10) + 1;}while((*________)(b, _b_b_) == -1);b[_b_b_-1] = 0x6F;}
  16. void ___(int(*________)(int* b, int c), int* b){char c;int _c_;do{printf("\nEnter move: ");}while(!(((scanf("%d%c", &_c_, &c)!=2 || c!='\n') && _()) ||_c_<1 || _c_>9) && ((*________)(b, _c_) == -1));b[_c_-1] = 0x78;}
  17. int _____(int* b, int place){if((b[place-1] == 0x6F)||(b[place-1] == 0x78)){printf("\nInvalid move.");return -1;}return 1;}
  18. void __(int* b){int _b_; printf("\n");for (_b_ = 0; _b_ < 7; _b_+=3){printf("%c | %c | %c\n", b[_b_], b[_b_+1], b[_b_+2]);if(_b_ < 4)printf("----------\n");}}
  19. int _(){while (getchar()!='\n');return 1;}
  20. int ____(int* b){int _b_;for(_b_ = 0; _b_ < 7; _b_+=3)if((b[_b_] == b[_b_+1]) && (b[_b_] == b[_b_+2]) && (b[_b_] != 0x20))return b[_b_];for(_b_ = 0; _b_ < 3; _b_++)if((b[_b_] == b[_b_+3]) && (b[_b_] == b[_b_+6]) && (b[_b_] != 0x20))return b[_b_];if((b[0] == b[4]) && (b[0] == b[8]) && (b[0] != 0x20))return b[0];if((b[2] == b[4]) && (b[2] == b[6]) && (b[2] != 0x20))return b[2];return -1;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement