Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //logic in main()
- do
- {
- cout << "Ok, player " << enterer << ", please enter your question.n > " << endl;
- cin.get(question, QMAX, '\n');
- cin.ignore(120, '\n');
- clear_screen();
- question_displayer(answerer, first_player, not_first_player, enterer,
- points_0, points_1, question, guess);
- word_analyzer(question, guess);
- //point display
- turn_switcher(first_player, not_first_player, enterer, answerer, points_0, points_1);
- } while (points_0 != 0 && points_1 != 0);
- void question_displayer(bool answerer, bool first_player, bool not_first_player, bool enterer,
- int & points_0, int & points_1, char question[], char guess[])
- {
- char again; // for user to say if they want to see it again
- int j = 0; //indexer
- cout << "pre while loop test - o";
- while (j < 3);
- {
- cout << "Ok, here's the question for you to answer:\n " << question << endl;
- switch (j)
- {
- case '0': //on the 1st try they are given the most time and no points deducted
- for (double i = 902983333; i > 1; i--)
- {
- (i / 987345.1111111111) * 13.52985093248509398735;
- }
- break;
- case '1': //2nd try, less time and 1 point deducted from the answerer
- for (double i = 902983333; i > 1; i--)
- {
- (i / 987345.11111111) * 13.529850932485093987;
- }
- decr(answerer, first_player, not_first_player, points_0, points_1);
- break;
- case '2': //3rd and final try. Less time and 1 point deducted.
- for (double i = 902983333; i > 1; i--)
- {
- (i / 987345.111111) * 13.5298509324850939;
- }
- decr(answerer, first_player, not_first_player, points_0, points_1);
- break;
- case '3':
- cout << "Time's up - no more tries left." << endl;
- break;
- default:
- cout << "Time's up - no more tries left." << endl;
- }
- clear_screen();
- cout << "Need to see it again? Enter y or n.\n > ";
- cin >> again;
- if (again == 'n')
- guess_intake(question, guess);
- else if (again == 'y');
- j++;
- }
- cout << "Sorry - it's time to guess the question, now." << endl;
- guess_intake(question, guess);
- }
- void clear_screen()
- {
- for (int i = 0; i < 100; i++)
- {
- cout << "\n";
- }
- cout << "Screen cleared." << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement