Browse Source

million game - exits on wrong answer

main
fdlt3917 2 years ago
parent
commit
083d929018
  1. 7
      src/main/quizproject.c

7
src/main/quizproject.c

@ -660,6 +660,7 @@ void play_milliongame() {
int million_i = 0; int million_i = 0;
char million_user_answers[round]; char million_user_answers[round];
char million_std_answers[round] = {'B', 'A', 'A'}; char million_std_answers[round] = {'B', 'A', 'A'};
int million_stay_in_game = 0;
char questions[round][256] = { char questions[round][256] = {
"What is the capital of France?", "What is the capital of France?",
@ -672,7 +673,7 @@ void play_milliongame() {
{ "A) Los Angeles Lakers", "B) Chicago Bulls", "C) Golden State Warriors", "D) Boston Celtics" }, { "A) Los Angeles Lakers", "B) Chicago Bulls", "C) Golden State Warriors", "D) Boston Celtics" },
}; };
while(million_i < round){
while(million_i < round && million_stay_in_game == 0){
printf("\n%s\n",questions[million_i]); printf("\n%s\n",questions[million_i]);
for(int j=0;j<4;j++){ for(int j=0;j<4;j++){
printf("%s\n",answers[million_i][j]); printf("%s\n",answers[million_i][j]);
@ -691,6 +692,7 @@ void play_milliongame() {
} }
else{ else{
printf("\nIncorrect!"); printf("\nIncorrect!");
million_stay_in_game == 1;
} }
break; break;
case 'B': case 'B':
@ -699,6 +701,7 @@ void play_milliongame() {
} }
else{ else{
printf("\nIncorrect!"); printf("\nIncorrect!");
million_stay_in_game == 1;
} }
break; break;
case 'C': case 'C':
@ -707,6 +710,7 @@ void play_milliongame() {
} }
else{ else{
printf("\nIncorrect!"); printf("\nIncorrect!");
million_stay_in_game == 1;
} }
break; break;
case 'D': case 'D':
@ -715,6 +719,7 @@ void play_milliongame() {
} }
else{ else{
printf("\nIncorrect!"); printf("\nIncorrect!");
million_stay_in_game == 1;
} }
break; break;
default: default:

Loading…
Cancel
Save