From bf1323e37af142503d8874c7db32b3ed4fa8766b Mon Sep 17 00:00:00 2001 From: fdlt3914 Date: Tue, 31 Jan 2023 02:21:59 +0000 Subject: [PATCH] smart_brain display instruction --- src/main/quizproject.c | 31 +++++++++++++++++++++++++++++-- src/main/quizproject.h | 9 +++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/main/quizproject.c b/src/main/quizproject.c index f0afcf3..9d2e0cc 100644 --- a/src/main/quizproject.c +++ b/src/main/quizproject.c @@ -25,6 +25,28 @@ int* randomNumber() { return arr; } + +//-------smart_brain_quiz_begin---------- + +void e_press_key_start() { + char e_start_game; + scanf(" %c", &e_start_game); + e_start_game = toupper(e_start_game); +} + +void e_display_instruction() { + printf("\t\t-------------------------------------------------------\n"); + printf("\t\t To start this Quiz, here are the instructions\n"); + printf("\t\t------------------------------------------------------\n\n"); + printf("\t\t>>Press any key and enter to begin the Quiz.<<\n\n"); + e_press_key_start(); +} + +void e_smart_brain() { + e_display_instruction(); +} +//-------smart_brain_quiz_end------------ + void displayWelcomeMessage(void) { displayGameInstructions(); } @@ -656,14 +678,15 @@ int main() { int jump_to_menu = 0; - while (choice != 6 || jump_to_menu) { + while (choice != 7 || jump_to_menu) { printf("Welcome to the Game Menu!\n"); printf("1. QuizGame\n"); printf("2. Fact or Lie?\n"); printf("3. Who wants to be a millionaire\n"); printf("4. Guess the Number!\n"); printf("5. Guess the Word!\n"); - printf("6. Exit\n"); + printf("6. Smart Brain\n"); + printf("7. Exit\n"); printf("Enter your choice: "); scanf("%d", &choice); @@ -689,6 +712,10 @@ int main() { jump_to_menu = 1; break; case 6: + e_smart_brain(); + jump_to_menu = 1; + break; + case 7: printf("\nThank you for trying our C code!\n"); break; default: diff --git a/src/main/quizproject.h b/src/main/quizproject.h index 2497fc2..616b237 100644 --- a/src/main/quizproject.h +++ b/src/main/quizproject.h @@ -29,6 +29,15 @@ void v_factorlie(void); void v_guessingGame(void); void v_guessTheWord(char word[], char guessed[]); + +//----smart_brain_header_begin----- + +void e_press_key_start(void); +void e_display_instruction(void); +void e_smart_brain(void); + +//----smart_brain_header_end------- + #define NUM_QUESTIONS 5 #define round 3 #define MAX_LIVES 10