Browse Source

Added a test round (epic game)

main
fdlt3885 2 years ago
parent
commit
edd57e711e
  1. 21
      src/main/quizproject.c
  2. 1
      src/main/quizproject.h

21
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"); 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() { void b_epic_game() {
B_displayWelcomeMessage(); B_displayWelcomeMessage();
b_entertostart(); b_entertostart();
@ -879,6 +898,8 @@ void b_epic_game() {
B_userinfo(); B_userinfo();
B_displayGameInstructions(); B_displayGameInstructions();
B_show_time(); B_show_time();
int total_score = 0;
total_score += B_testround();
} }

1
src/main/quizproject.h

@ -53,6 +53,7 @@ void B_sayhello(char name[]);
void B_userinfo(void); void B_userinfo(void);
void B_displayGameInstructions(void); void B_displayGameInstructions(void);
void B_show_time(void); void B_show_time(void);
int B_testround(void);
#define NUM_QUESTIONS 5 #define NUM_QUESTIONS 5
#define round 3 #define round 3

Loading…
Cancel
Save