From 121c53330e17c433dddc8b9d9525ed569a541d2c Mon Sep 17 00:00:00 2001 From: fdlt3917 Date: Wed, 1 Feb 2023 09:02:47 +0000 Subject: [PATCH] million game - added fifty option --- src/main/quizproject.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/main/quizproject.c b/src/main/quizproject.c index a6dde08..a45eb1d 100644 --- a/src/main/quizproject.c +++ b/src/main/quizproject.c @@ -657,11 +657,11 @@ void play_factorlie() { void play_milliongame() { printf("Playing who wants to be a millionaire...\n"); - int million_i = 0; + int million_i = 0, million_k = 0;; char million_user_answers[round]; char million_std_answers[round] = {'B', 'A', 'A'}; int million_stay_in_game = 0; - int million_lifeline_hint = 1; + int million_lifeline_hint = 1, million_lifeline_delete = 1; char questions[round][256] = { "What is the capital of France?", @@ -729,6 +729,32 @@ void play_milliongame() { goto point_one; + 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!"); + } + else{ + million_stay_in_game = 1; + printf("\nIncorrect!"); + } break; default: goto point_one;