From cf2cff970f6a32412582fd4411ef82d33df8e564 Mon Sep 17 00:00:00 2001 From: fdlt3917 Date: Wed, 8 Feb 2023 10:24:28 +0000 Subject: [PATCH] million game - added NUM_ROUND definition --- src/main/quizproject.c | 10 +++++----- src/main/quizproject.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/quizproject.c b/src/main/quizproject.c index 8e17ae5..e851401 100644 --- a/src/main/quizproject.c +++ b/src/main/quizproject.c @@ -1236,12 +1236,12 @@ void play_milliongame() { printf("\nPlaying who wants to be a millionaire...\n\n"); int million_i = 0, million_k = 0;; - char million_user_answers[round]; - char million_std_answers[round] = {'B', 'C', 'D', 'C', 'B', 'D', 'B', 'A', 'B', 'B', 'A', 'D', 'C', 'C', 'B'}; + char million_user_answers[NUM_ROUNDS]; + char million_std_answers[NUM_ROUNDS] = {'B', 'C', 'D', 'C', 'B', 'D', 'B', 'A', 'B', 'B', 'A', 'D', 'C', 'C', 'B'}; int million_stay_in_game = 0, million_reward = 0, million_checkpoint = 0, million_count_replace = 0; int million_lifeline_hint = 1, million_lifeline_delete = 1, million_lifeline_friend = 1; - char questions[round][256] = { + char questions[NUM_ROUNDS][256] = { "What is the capital of France?", "Which Disney character famously leaves a glass slipper behind at a royal ball?", "What name is given to the revolving belt machinery in an airport that delivers checked luggage from the plane to baggage reclaim?", @@ -1258,7 +1258,7 @@ void play_milliongame() { "Who is the only British politician to have held all four “Great Offices of State” at some point during their career?", "In 1718, which pirate died in battle off the coast of what is now North Carolina?" }; - char answers[round][4][256] = { + char answers[NUM_ROUNDS][4][256] = { { "A) Berlin", "B) Paris", "C) London", "D) Rome" }, { "A) Pocahontas", "B) Sleeping Beauty", "C) Cinderella", "D) Elsa" }, { "A) Hangar", "B) Terminal", "C) Concourse", "D) Carousel" }, @@ -1278,7 +1278,7 @@ void play_milliongame() { million_instructions(); - while(million_i < round && million_stay_in_game == 0){ + while(million_i < NUM_ROUNDS && million_stay_in_game == 0){ printf("\nYou have %d:Fifty/Fifty\t%d:Phone a Friend\t%d:Hint\t\n",million_lifeline_delete,million_lifeline_friend,million_lifeline_hint); diff --git a/src/main/quizproject.h b/src/main/quizproject.h index 4bfacc9..e8b18d3 100644 --- a/src/main/quizproject.h +++ b/src/main/quizproject.h @@ -97,7 +97,7 @@ void B_write_review(void); #define NUM_QUESTIONS 5 -#define round 15 +#define NUM_ROUNDS 15 #define MAX_LIVES 10 #define MAX_WORD_LENGTH 20 #define ROCK 1