From 360c6354ddcb78594a85c5a01275af6e3c7ef9c5 Mon Sep 17 00:00:00 2001 From: fdlt3917 Date: Wed, 1 Feb 2023 10:56:47 +0000 Subject: [PATCH] million game - only one 50/50 lifeline available --- src/main/quizproject.c | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/src/main/quizproject.c b/src/main/quizproject.c index 7533d9c..0fbb587 100644 --- a/src/main/quizproject.c +++ b/src/main/quizproject.c @@ -737,29 +737,25 @@ void play_milliongame() { } break; case 'F': - million_lifeline_delete = 0; - printf("\nComputer will now MARK two wrong answers...\n"); - - while(million_k < 4 && million_count_replace < 2){ - if(answers[million_i][million_k][0] != million_std_answers[million_i]){ - answers[million_i][million_k][0] = 'X'; - million_count_replace = million_count_replace + 1; - } - million_k++; - } - for(int million_n = 0; million_n < 4; million_n++){ - printf("%s\n",answers[million_i][million_n]); - } - printf("Enter a valid Response: "); - scanf(" %c", &million_user_answers[million_i]); - million_user_answers[million_i] = toupper(million_user_answers[million_i]); - - if(million_user_answers[million_i] == million_std_answers[million_i]){ - printf("\nCorrect!"); + if(million_lifeline_delete != 1){ + printf("\nFifty/Fifty lifeline already used\n"); + goto point_one; } - else{ - million_stay_in_game = 1; - printf("\nIncorrect!"); + else { + million_lifeline_delete = 0; + printf("\nComputer will now MARK two wrong answers...\n"); + + while(million_k < 4 && million_count_replace < 2){ + if(answers[million_i][million_k][0] != million_std_answers[million_i]){ + answers[million_i][million_k][0] = 'X'; + million_count_replace = million_count_replace + 1; + } + million_k++; + } + for(int million_n = 0; million_n < 4; million_n++){ + printf("%s\n",answers[million_i][million_n]); + } + goto point_one; } break; case 'P':