Browse Source

provide introduction to enter game and exit

main
parent
commit
d41730bc13
  1. 25
      src/main/quizproject.c
  2. 1
      src/main/quizproject.h

25
src/main/quizproject.c

@ -181,6 +181,29 @@ void math_display_choice(){
} }
void math_enter_game() {
int choice = 0;
printf("\t\t-------------------------------------------------------\n");
printf("\t\t Please enter 1 to start the game\n ");
printf("\t\t Please enter 0 to exit \n");
printf("\t\t-------------------------------------------------------\n\n");
printf("Enter your choice: ");
scanf("%d", &choice);
switch (choice){
// in order to start the game
case 1:
math_display_choice();
break;
default:
printf("\t\t-------------------------------------------------------\n");
printf("\t\t Sorry to see you go.\n ");
printf("\t\t-------------------------------------------------------\n\n");
}
}
//------------Math_quiz_end-------------- //------------Math_quiz_end--------------
@ -2175,7 +2198,7 @@ int main(int argc, char *argv[]) {
jump_to_menu = 1; jump_to_menu = 1;
break; break;
case 9: case 9:
math_display_choice();
math_enter_game();
jump_to_menu = 1; jump_to_menu = 1;
break; break;
case 10: case 10:

1
src/main/quizproject.h

@ -41,6 +41,7 @@ void million_exit(int million_a);
void math_choose_question(int); void math_choose_question(int);
int math_answer(int); int math_answer(int);
void math_display_choice(); void math_display_choice();
void math_enter_game();
//------Math_quiz_header_end------- //------Math_quiz_header_end-------

Loading…
Cancel
Save