|
@ -123,11 +123,64 @@ bool e_true_false(char choice) { |
|
|
} else { |
|
|
} else { |
|
|
return -1; |
|
|
return -1; |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void e_questions_r3(void) { |
|
|
|
|
|
|
|
|
|
|
|
char questions[][100] ={ |
|
|
|
|
|
"Which country started WW3?\n", |
|
|
|
|
|
"What is the strongest Metal in the world?\n", |
|
|
|
|
|
"which holy City do Muslim go on a pilgrimage to? \n" |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
char answers [][100] = { |
|
|
|
|
|
"germany", |
|
|
|
|
|
"tungsten", |
|
|
|
|
|
"mecca" |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
e_printout_r3 (questions, answers); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void e_printout_r3 (char question[][100], char answers[][100]) { |
|
|
|
|
|
int i; |
|
|
|
|
|
char user_answer[100]; |
|
|
|
|
|
printf("\t\t---------------------------Round3-----------------------------\n"); |
|
|
|
|
|
printf("\t\t >>In this round you will be presented with 3 questions.<<\n"); |
|
|
|
|
|
printf("\t\t--------------------------------------------------------------\n\n"); |
|
|
|
|
|
for(i = 0; i < 3; i++) { |
|
|
|
|
|
int k = 0; |
|
|
|
|
|
printf("[%d]. %s",i+6,question[i]); |
|
|
|
|
|
printf(" Your answer: "); |
|
|
|
|
|
scanf("%s", user_answer); |
|
|
|
|
|
int num = strlen(user_answer); |
|
|
|
|
|
char ans[50]; |
|
|
|
|
|
for (int j = 0; j < 9; j++) { |
|
|
|
|
|
ans[j] = answers[i][j]; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (int j = 0; j < strlen(ans); j++) { |
|
|
|
|
|
if (ans[j] == tolower(user_answer[j])){ |
|
|
|
|
|
k++; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (k == strlen(ans) && num == strlen(ans)) { |
|
|
|
|
|
score++; |
|
|
|
|
|
correct(score); |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
wrong(score); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void e_smart_brain() { |
|
|
void e_smart_brain() { |
|
|
e_display_instruction(); |
|
|
e_display_instruction(); |
|
|
e_ask_questions(); |
|
|
e_ask_questions(); |
|
|
|
|
|
e_questions_r3(); |
|
|
} |
|
|
} |
|
|
//-------smart_brain_quiz_end------------ |
|
|
//-------smart_brain_quiz_end------------ |
|
|
|
|
|
|
|
|