|
@ -30,6 +30,51 @@ int* randomNumber() { |
|
|
|
|
|
|
|
|
//------------Math_quiz_begin------------ |
|
|
//------------Math_quiz_begin------------ |
|
|
|
|
|
|
|
|
|
|
|
void math_help(){ |
|
|
|
|
|
printf( "\n\n Instructions that are supposed to be followed\n" ); |
|
|
|
|
|
printf("......................................................\n\n" ); |
|
|
|
|
|
printf( "As soon as you answer a question, you will be directed to the next question without any pause. " ); |
|
|
|
|
|
printf( "\n\n !! Wish you all the best !! \n\n " ); |
|
|
|
|
|
printf("......................................................\n" ); |
|
|
|
|
|
printf( "\n Do you still wish to continue playing ? If yes, then press 1. Else, press 0 : " ); |
|
|
|
|
|
int input1; |
|
|
|
|
|
scanf("%d", &input1); |
|
|
|
|
|
|
|
|
|
|
|
if( input1 == 1 ){ |
|
|
|
|
|
math_enter_game(); |
|
|
|
|
|
} else{ |
|
|
|
|
|
printf("\t\t-------------------------------------------------------\n"); |
|
|
|
|
|
printf("\t\t Sorry to see you go.\n "); |
|
|
|
|
|
printf("\t\t-------------------------------------------------------\n\n"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void math_choose_game() { |
|
|
|
|
|
printf("\t\t-------------------------------------------------------\n"); |
|
|
|
|
|
printf("\t\t There are Two type of Math quiz\n"); |
|
|
|
|
|
printf("\t\t A]. Easy-Math\n"); |
|
|
|
|
|
printf("\t\t B]. Hard-Math\n"); |
|
|
|
|
|
printf("\t\t-------------------------------------------------------\n\n"); |
|
|
|
|
|
printf("\t\t Type any key and press enter to exit\n"); |
|
|
|
|
|
printf("\t\t Choose either A or B to begin the quiz you want\n"); |
|
|
|
|
|
|
|
|
|
|
|
char choose; |
|
|
|
|
|
scanf(" %c", &choose); |
|
|
|
|
|
choose = toupper(choose); |
|
|
|
|
|
if (choose == 'A'){ |
|
|
|
|
|
math_display_choice(); |
|
|
|
|
|
} else if(choose == 'B'){ |
|
|
|
|
|
e_math_ques(); |
|
|
|
|
|
} else { |
|
|
|
|
|
printf("\t\t-------------------------------------------------------\n"); |
|
|
|
|
|
printf("\t\t Sorry to see you go.\n "); |
|
|
|
|
|
printf("\t\t-------------------------------------------------------\n\n"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void math_choose_question(int num1) { |
|
|
void math_choose_question(int num1) { |
|
|
char choose [][100] = { |
|
|
char choose [][100] = { |
|
|
"what is 1 + 1\n", |
|
|
"what is 1 + 1\n", |
|
@ -232,9 +277,9 @@ void e_math_print(char e_ques[][140], char e_poss[][140]){ |
|
|
void math_enter_game() { |
|
|
void math_enter_game() { |
|
|
int choice = 0; |
|
|
int choice = 0; |
|
|
printf("\t\t-------------------------------------------------------\n"); |
|
|
printf("\t\t-------------------------------------------------------\n"); |
|
|
printf("\t\t Please enter 1 to start the game 1\n "); |
|
|
|
|
|
printf("\t\t Please enter 2 to start the game 2\n "); |
|
|
|
|
|
printf("\t\t Please enter 0 to exit \n"); |
|
|
|
|
|
|
|
|
printf("\t\t Please press 1 to enter Quiz-game \n "); |
|
|
|
|
|
printf("\t\t Please press 2 to see Instruction\n "); |
|
|
|
|
|
printf("\t\t Please press 0 to Exit \n"); |
|
|
printf("\t\t-------------------------------------------------------\n\n"); |
|
|
printf("\t\t-------------------------------------------------------\n\n"); |
|
|
printf("Enter your choice: "); |
|
|
printf("Enter your choice: "); |
|
|
|
|
|
|
|
@ -242,10 +287,10 @@ void math_enter_game() { |
|
|
switch (choice){ |
|
|
switch (choice){ |
|
|
// in order to start the game |
|
|
// in order to start the game |
|
|
case 1: |
|
|
case 1: |
|
|
math_display_choice(); |
|
|
|
|
|
|
|
|
math_choose_game(); |
|
|
break; |
|
|
break; |
|
|
case 2: |
|
|
case 2: |
|
|
e_math_ques(); |
|
|
|
|
|
|
|
|
math_help(); |
|
|
break; |
|
|
break; |
|
|
default: |
|
|
default: |
|
|
printf("\t\t-------------------------------------------------------\n"); |
|
|
printf("\t\t-------------------------------------------------------\n"); |
|
|