Browse Source

smart_brain display instruction

main
parent
commit
bf1323e37a
  1. 31
      src/main/quizproject.c
  2. 9
      src/main/quizproject.h

31
src/main/quizproject.c

@ -25,6 +25,28 @@ int* randomNumber() {
return arr; 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) { void displayWelcomeMessage(void) {
displayGameInstructions(); displayGameInstructions();
} }
@ -656,14 +678,15 @@ int main() {
int jump_to_menu = 0; 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("Welcome to the Game Menu!\n");
printf("1. QuizGame\n"); printf("1. QuizGame\n");
printf("2. Fact or Lie?\n"); printf("2. Fact or Lie?\n");
printf("3. Who wants to be a millionaire\n"); printf("3. Who wants to be a millionaire\n");
printf("4. Guess the Number!\n"); printf("4. Guess the Number!\n");
printf("5. Guess the Word!\n"); printf("5. Guess the Word!\n");
printf("6. Exit\n");
printf("6. Smart Brain\n");
printf("7. Exit\n");
printf("Enter your choice: "); printf("Enter your choice: ");
scanf("%d", &choice); scanf("%d", &choice);
@ -689,6 +712,10 @@ int main() {
jump_to_menu = 1; jump_to_menu = 1;
break; break;
case 6: case 6:
e_smart_brain();
jump_to_menu = 1;
break;
case 7:
printf("\nThank you for trying our C code!\n"); printf("\nThank you for trying our C code!\n");
break; break;
default: default:

9
src/main/quizproject.h

@ -29,6 +29,15 @@ void v_factorlie(void);
void v_guessingGame(void); void v_guessingGame(void);
void v_guessTheWord(char word[], char guessed[]); 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 NUM_QUESTIONS 5
#define round 3 #define round 3
#define MAX_LIVES 10 #define MAX_LIVES 10

Loading…
Cancel
Save