From edd57e711e56d3905a36749c9713ab2572689f03 Mon Sep 17 00:00:00 2001 From: fdlt3885 Date: Tue, 31 Jan 2023 22:05:15 +0000 Subject: [PATCH] Added a test round (epic game) --- src/main/quizproject.c | 21 +++++++++++++++++++++ src/main/quizproject.h | 1 + 2 files changed, 22 insertions(+) diff --git a/src/main/quizproject.c b/src/main/quizproject.c index 63fe338..34fd95f 100644 --- a/src/main/quizproject.c +++ b/src/main/quizproject.c @@ -872,6 +872,25 @@ void B_displayGameInstructions() { printf("\t\t To start this game, here are the instructions:\n\n # Read each question carefully and select the best answer from the choices provided.\n # You will receive points for each correct answer, and the game will keep track of your progress.\n # At the end of the game, you will be shown your final score and will have the option to play again.\n # Have fun and good luck!\n\n\n"); } +int B_testround(void) { + int score = 0; + char answer[20]; + + printf("Play a Test Round!\n"); + printf("The points you get in this round will be added to the other rounds.\n"); + printf("Question 1: What is the capital of Spain?\n"); + printf("Options: a.)Madrid b.)Barcelona c.)Valencia d.)Granada "); + printf("Answer: "); + scanf("%s", answer); + + printf("Question 2: What is the smallest planet in our solar system?\n"); + printf("Options: a.)Earth b.)Mars c.)Mercury d.)Sun "); + printf("Answer: "); + scanf("%s", answer); + +} + + void b_epic_game() { B_displayWelcomeMessage(); b_entertostart(); @@ -879,6 +898,8 @@ void b_epic_game() { B_userinfo(); B_displayGameInstructions(); B_show_time(); + int total_score = 0; + total_score += B_testround(); } diff --git a/src/main/quizproject.h b/src/main/quizproject.h index 5725d3f..04feaae 100644 --- a/src/main/quizproject.h +++ b/src/main/quizproject.h @@ -53,6 +53,7 @@ void B_sayhello(char name[]); void B_userinfo(void); void B_displayGameInstructions(void); void B_show_time(void); +int B_testround(void); #define NUM_QUESTIONS 5 #define round 3