|
|
@ -78,13 +78,7 @@ void fifty_fifty(int question_num) { |
|
|
|
}; |
|
|
|
printf("%s\n",qC[question_num]); |
|
|
|
} |
|
|
|
|
|
|
|
void looping(char qS[][100], char qC[][100], char aS[]){ |
|
|
|
|
|
|
|
int k = 0; |
|
|
|
while(k < 1){ |
|
|
|
printf("\t\t--------------------Round 1-------------------\n\n"); |
|
|
|
printf(">>In this round you need to answer 3 questions correctly to move to Round 2<<\n\n"); |
|
|
|
void printOutOption(char qS[][100], char qC[][100],char aS[]){ |
|
|
|
char response; |
|
|
|
for (int i = 0; i < 1; i++){ |
|
|
|
printf("%s\n", qS[i]); |
|
|
@ -109,88 +103,50 @@ int k = 0; |
|
|
|
if(response == aS[i]){ |
|
|
|
score++; |
|
|
|
correct(score); |
|
|
|
|
|
|
|
fact(i); |
|
|
|
} else { |
|
|
|
wrong(score); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void looping(char qS[][100], char qC[][100], char aS[]){ |
|
|
|
|
|
|
|
int k = 0; |
|
|
|
while(k < 1){ |
|
|
|
printf("\t\t--------------------Round 1-------------------\n\n"); |
|
|
|
printf(">>In this round you need to answer 3 questions correctly to move to Round 2<<\n\n"); |
|
|
|
|
|
|
|
printOutOption(qS,qC,aS);//2 |
|
|
|
|
|
|
|
if (score < 1) { |
|
|
|
printf("You lost! Better luck next time\n"); |
|
|
|
break; |
|
|
|
} else { |
|
|
|
printf("\t\t--------------------Round 2-------------------\n\n"); |
|
|
|
printf(">>In this round you need to answer 2 questions correctly to move to Round 3<<\n\n"); |
|
|
|
char response; |
|
|
|
for (int i = 0; i < 1; i++){ |
|
|
|
printf("%s\n", qS[i]); |
|
|
|
printf("%s\n", qC[i]); |
|
|
|
printf("Enter your answer (A, B, C, or D) or use a lifeline (F for 50/50, H for hint): "); |
|
|
|
scanf(" %c", &response); |
|
|
|
response = toupper(response); |
|
|
|
if (response == 'F') { |
|
|
|
fifty_fifty(i); |
|
|
|
printf("Enter your answer (A, B, C, or D): "); |
|
|
|
scanf(" %c", &response); |
|
|
|
response = toupper(response); |
|
|
|
}else if (response == 'H') { |
|
|
|
hint(i); |
|
|
|
printf("Enter your answer (A, B, C, or D): "); |
|
|
|
scanf(" %c", &response); |
|
|
|
response = toupper(response); |
|
|
|
|
|
|
|
printOutOption(qS,qC,aS);//3 |
|
|
|
} |
|
|
|
|
|
|
|
if(response == aS[i]){ |
|
|
|
score++; |
|
|
|
correct(score); |
|
|
|
|
|
|
|
} else { |
|
|
|
wrong(score); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (score < 1) { |
|
|
|
printf("You lost! Better luck next time\n"); |
|
|
|
break; |
|
|
|
} else { |
|
|
|
printf("\t\t--------------------Round 3-------------------\n\n"); |
|
|
|
printf(">>In this round you need to answer 2 questions correctly to move to Round 4<<\n\n"); |
|
|
|
char response; |
|
|
|
for (int i = 0; i < 1; i++) { |
|
|
|
printf("%s\n", qS[i]); |
|
|
|
printf("%s\n", qC[i]); |
|
|
|
printf("Enter your answer (A, B, C, or D) or use a lifeline (F for 50/50, H for hint): "); |
|
|
|
scanf(" %c", &response); |
|
|
|
response = toupper(response); |
|
|
|
if (response == 'F') { |
|
|
|
fifty_fifty(i); |
|
|
|
printf("Enter your answer (A, B, C, or D): "); |
|
|
|
scanf(" %c", &response); |
|
|
|
response = toupper(response); |
|
|
|
} else if (response == 'H') { |
|
|
|
hint(i); |
|
|
|
printf("Enter your answer (A, B, C, or D): "); |
|
|
|
scanf(" %c", &response); |
|
|
|
response = toupper(response); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
printOutOption(qS,qC,aS);//3 |
|
|
|
|
|
|
|
if (response == aS[i]) { |
|
|
|
score++; |
|
|
|
correct(score); |
|
|
|
|
|
|
|
} else { |
|
|
|
wrong(score); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
k++; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void ask_questions(void) { |
|
|
|
char qS[][100] = { |
|
|
|
"What is the name of the tallest mountain in the world?\n" |
|
|
|