Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.67 KB | None | 0 0
  1. //logic in main()
  2.     do
  3.     {
  4.         cout << "Ok, player " << enterer << ", please enter your question.n > " << endl;
  5.         cin.get(question, QMAX, '\n');
  6.         cin.ignore(120, '\n');
  7.         clear_screen();
  8.         question_displayer(answerer, first_player, not_first_player, enterer,
  9.                            points_0, points_1, question, guess);
  10.         word_analyzer(question, guess);
  11.         //point display
  12.         turn_switcher(first_player, not_first_player, enterer, answerer, points_0, points_1);
  13.     } while (points_0 != 0 && points_1 != 0);
  14.  
  15.  
  16. void question_displayer(bool answerer, bool first_player, bool not_first_player, bool enterer,
  17.                         int & points_0, int & points_1, char question[], char guess[])
  18. {
  19.     char again; // for user to say if they want to see it again
  20.     int j = 0; //indexer
  21.     cout << "pre while loop test - o";
  22.     while (j < 3);
  23.     {
  24.         cout << "Ok, here's the question for you to answer:\n " << question << endl;
  25.             switch (j)
  26.             {
  27.             case '0': //on the 1st try they are given the most time and no points deducted
  28.                 for (double i = 902983333; i > 1; i--)
  29.                 {
  30.                     (i / 987345.1111111111) * 13.52985093248509398735;
  31.                 }
  32.                 break;
  33.             case '1': //2nd try, less time and 1 point deducted from the answerer
  34.                 for (double i = 902983333; i > 1; i--)
  35.                 {
  36.                    (i / 987345.11111111) * 13.529850932485093987;
  37.                 }
  38.                 decr(answerer, first_player, not_first_player, points_0, points_1);
  39.                 break;
  40.             case '2': //3rd and final try.  Less time and 1 point deducted.
  41.                 for (double i = 902983333; i > 1; i--)
  42.                 {
  43.                     (i / 987345.111111) * 13.5298509324850939;
  44.                 }
  45.                 decr(answerer, first_player, not_first_player, points_0, points_1);
  46.                 break;
  47.             case '3':
  48.                 cout << "Time's up - no more tries left." << endl;
  49.                 break;
  50.             default:
  51.                 cout << "Time's up - no more tries left." << endl;
  52.             }
  53.         clear_screen();
  54.         cout << "Need to see it again?  Enter y or n.\n > ";
  55.         cin >> again;
  56.         if (again == 'n')
  57.             guess_intake(question, guess);
  58.         else if (again == 'y');
  59.             j++;
  60.     }
  61.     cout << "Sorry - it's time to guess the question, now." << endl;
  62.     guess_intake(question, guess);
  63. }
  64.  
  65.  
  66. void clear_screen()
  67. {
  68.     for (int i = 0; i < 100; i++)
  69.     {
  70.         cout << "\n";
  71.     }
  72.     cout << "Screen cleared." << endl;
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement