From ac7fbd4d572f9b6d5a3e2d65560480fafbfc9a61 Mon Sep 17 00:00:00 2001 From: fdlt3917 Date: Wed, 1 Feb 2023 11:09:22 +0000 Subject: [PATCH] million game - Friend Lifeline used only once --- src/main/quizproject.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/main/quizproject.c b/src/main/quizproject.c index 0fbb587..5bea590 100644 --- a/src/main/quizproject.c +++ b/src/main/quizproject.c @@ -759,20 +759,18 @@ void play_milliongame() { } break; case 'P': - million_lifeline_friend = 0; - printf("\nYou can now ask a friend for help...\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!"); - } + if(million_lifeline_friend != 1){ + printf("\nLifeline Friend already used\n"); + goto point_one; + } + else{ + million_lifeline_friend = 0; + printf("\nYou can now ask a friend for help...\n"); + for(int j=0;j<4;j++){ + printf("%s\n",answers[million_i][j]); + } + goto point_one; + } break; default: goto point_one;