Browse Source

refactoring: remove switch in math_fact_print()

main
parent
commit
9776d89de6
  1. 14
      src/main/quizproject.c

14
src/main/quizproject.c

@ -624,10 +624,10 @@ void print_guess_word_question (char guessWord[][100], char guessSolution[][100]
if (k == strlen(arr) && strlen(usr_ans) == strlen(arr)) { if (k == strlen(arr) && strlen(usr_ans) == strlen(arr)) {
score++; score++;
printf("Correct!\nYou have %d points\n",score);
correct(score);
printf("You guessed right! The word is rightfully, %s!\n\n", guessedWord[runNum]); printf("You guessed right! The word is rightfully, %s!\n\n", guessedWord[runNum]);
} else { } else {
printf("Wrong!\nYou have %d points\n", score);
wrong(score);
} }
} }
@ -669,10 +669,10 @@ void e_printout(char print_out_questn[][100], char questions[][100],int randArr[
} }
if (k == strlen(print_out_questn[rNum]) && strlen(usr_ans) == strlen(print_out_questn[rNum])) { if (k == strlen(print_out_questn[rNum]) && strlen(usr_ans) == strlen(print_out_questn[rNum])) {
score++; score++;
printf("Correct!\nYou have %d points\n", score);
correct(score);
} else { } else {
printf("Wrong!\n");
wrong(score);
printf("The word is: %s\n", questions[rNum]); printf("The word is: %s\n", questions[rNum]);
} }
} }
@ -824,14 +824,10 @@ void math_fact_lie_print() {
printf("\t ......................................................\n" ); printf("\t ......................................................\n" );
for(int i = 0; i < 8; i++){ for(int i = 0; i < 8; i++){
switch (i) {
case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
math_fact_lie(i); math_fact_lie(i);
printf("fact\\lie: "); printf("fact\\lie: ");
math_fact_lie_solutions(i);break;
}
math_fact_lie_solutions(i);
} }
} }

Loading…
Cancel
Save