nkk71

Untitled

Oct 8th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.13 KB | None | 0 0
  1. int main () {
  2.     int count = 0;
  3.     char answer = ' '; // anything but 'q'
  4.  
  5.     // first run, so start the kitchen
  6.     system("python3 superr");
  7.  
  8.     while (answer != 'q') {
  9.         printf("\n\n\"Q\" to Quit, or \"R\" to Restart, then press ENTER\n");
  10.         scanf (" %c", &answer);
  11.         answer = tolower(answer);
  12.  
  13.         if (answer != 'r' && answer != 'q') {
  14.             printf("Which part about Q or R did you not understand, you twat?\n");
  15.             // continue; // back to beginning of loop
  16.         }
  17.         else if (answer == 'r') {
  18.             count++;
  19.             if ((count % 10) == 1 && count != 11)
  20.                 printf("Restarting the kitchen for the %dst time\n", count);
  21.             else if ((count % 10) == 2 && count != 12)
  22.                 printf("Restarting the kitchen for the %dnd time\n", count);
  23.             else if ((count % 10) == 3 && count != 13)
  24.                 printf("Restarting the kitchen for the %drd time\n", count);
  25.             else
  26.                 printf("Restarting the kitchen for the %dth time\n", count);
  27.             system("python3 superr"); // restart kitchen
  28.             // continue; // back to beginning of loop
  29.         }
  30.         else {
  31.             printf("Fine you want to quit, so be it -_-\n");
  32.             // break; // 'q' is selected break out of loop
  33.         }
  34.     }
  35.     return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment