|
@ -440,9 +440,11 @@ displayThankYouMessage(); |
|
|
void v_factorlie(void){ |
|
|
void v_factorlie(void){ |
|
|
char statements[][100] = { |
|
|
char statements[][100] = { |
|
|
"Tomatoes are fruits.", // fact |
|
|
"Tomatoes are fruits.", // fact |
|
|
|
|
|
"The Great Wall of China is visible from space.", // lie |
|
|
|
|
|
"Water freezes at 0 degrees Celsius.", // fact |
|
|
|
|
|
|
|
|
}; |
|
|
}; |
|
|
char answers[] = {'F'}; // L for lie, F for fact |
|
|
|
|
|
|
|
|
char answers[] = {'F','L','F'}; // L for lie, F for fact |
|
|
int num_statements = sizeof(statements) / sizeof(statements[0]); |
|
|
int num_statements = sizeof(statements) / sizeof(statements[0]); |
|
|
int score = 0; |
|
|
int score = 0; |
|
|
|
|
|
|
|
@ -456,9 +458,9 @@ void v_factorlie(void){ |
|
|
user_answer = toupper(user_answer); |
|
|
user_answer = toupper(user_answer); |
|
|
if (user_answer == answers[i]) { |
|
|
if (user_answer == answers[i]) { |
|
|
score++; |
|
|
score++; |
|
|
printf("Correct!\n"); |
|
|
|
|
|
|
|
|
printf("Correct! You get a point.\n\n"); |
|
|
} else { |
|
|
} else { |
|
|
printf("Incorrect.\n"); |
|
|
|
|
|
|
|
|
printf("Sorry, its incorrect. No points!\n\n"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
printf("Your final score is %d out of %d.\n", score, num_statements); |
|
|
printf("Your final score is %d out of %d.\n", score, num_statements); |
|
|