|
@ -439,19 +439,21 @@ displayThankYouMessage(); |
|
|
|
|
|
|
|
|
void v_factorlie(void){ |
|
|
void v_factorlie(void){ |
|
|
char statements[][100] = { |
|
|
char statements[][100] = { |
|
|
"Tomatoes are fruits.", // lie |
|
|
|
|
|
|
|
|
"Tomatoes are fruits.", // fact |
|
|
|
|
|
|
|
|
}; |
|
|
}; |
|
|
char answers[] = {'L'}; // L for lie, F for fact |
|
|
|
|
|
|
|
|
char answers[] = {'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; |
|
|
|
|
|
|
|
|
|
|
|
printf("\nWelcome to the Fact or Lie Quiz!\n\n"); |
|
|
for (int i = 0; i < num_statements; i++) { |
|
|
for (int i = 0; i < num_statements; i++) { |
|
|
char user_answer; |
|
|
char user_answer; |
|
|
printf("Statement %d: %s\n\n", i + 1, statements[i]); |
|
|
printf("Statement %d: %s\n\n", i + 1, statements[i]); |
|
|
printf("Is this statement a fact (F) or a lie (L)?\n"); |
|
|
printf("Is this statement a fact (F) or a lie (L)?\n"); |
|
|
printf("Your answer: \n"); |
|
|
printf("Your answer: \n"); |
|
|
scanf(" %c", &user_answer); |
|
|
scanf(" %c", &user_answer); |
|
|
|
|
|
user_answer = toupper(user_answer); |
|
|
if (user_answer == answers[i]) { |
|
|
if (user_answer == answers[i]) { |
|
|
score++; |
|
|
score++; |
|
|
printf("Correct!\n"); |
|
|
printf("Correct!\n"); |
|
@ -464,7 +466,9 @@ void v_factorlie(void){ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void play_factorlie() { |
|
|
void play_factorlie() { |
|
|
printf("Playing game 2...\n"); |
|
|
|
|
|
|
|
|
printf("**********************\n"); |
|
|
|
|
|
printf("Playing Fact or Lie!\n"); |
|
|
|
|
|
printf("**********************\n"); |
|
|
v_factorlie(); |
|
|
v_factorlie(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|