|
|
@ -41,6 +41,7 @@ void activePlaying(char *fragen[], char *antworten[], int richtige_antwort[], in |
|
|
|
printf("Please type in your answer 1,2,3 or 4: "); |
|
|
|
eingabe = FEingabeInteger(); |
|
|
|
richtig = FcheckaufRichtigkeit(eingabe, richtige_antwort, i); |
|
|
|
printf("Bool richtig / falsch: %d\n", richtig); |
|
|
|
printf(" %d\n", richtige_antwort[i]); |
|
|
|
} |
|
|
|
} |
|
|
@ -62,31 +63,45 @@ bool FcheckaufRichtigkeit(int eingabe, int richtige_antwort[],int i){ |
|
|
|
switch (eingabe) { |
|
|
|
case 1: { |
|
|
|
printf("Case 1\n"); |
|
|
|
if (richtige_antwort[i] == 1) printf("Right Answer, well done.\n"); |
|
|
|
if (richtige_antwort[i] == 1) { |
|
|
|
printf("Right Answer, well done.\n"); |
|
|
|
return true; |
|
|
|
} |
|
|
|
else printf("Wrong answer.\n"); |
|
|
|
break; |
|
|
|
} |
|
|
|
case 2: { |
|
|
|
printf("Case 2\n"); |
|
|
|
if (richtige_antwort[i] == 2) printf("Right Answer, well done.\n"); |
|
|
|
if (richtige_antwort[i] == 2) { |
|
|
|
printf("Right Answer, well done.\n"); |
|
|
|
return true; |
|
|
|
} |
|
|
|
else printf("Wrong answer.\n"); |
|
|
|
break; |
|
|
|
} |
|
|
|
case 3: { |
|
|
|
printf("Case 3\n"); |
|
|
|
if (richtige_antwort[i] == 3) printf("Right Answer, well done.\n"); |
|
|
|
if (richtige_antwort[i] == 3) { |
|
|
|
printf("Right Answer, well done.\n"); |
|
|
|
return true; |
|
|
|
} |
|
|
|
else printf("Wrong answer.\n"); |
|
|
|
break; |
|
|
|
} |
|
|
|
case 4: { |
|
|
|
printf("Case 4\n"); |
|
|
|
if (richtige_antwort[i] == 4) printf("Right Answer, well done.\n"); |
|
|
|
if (richtige_antwort[i] == 4) { |
|
|
|
printf("Right Answer, well done.\n"); |
|
|
|
return true; |
|
|
|
} |
|
|
|
else printf("Wrong answer.\n"); |
|
|
|
break; |
|
|
|
} |
|
|
|
default: { |
|
|
|
printf("Wrong Input!"); |
|
|
|
return false; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
return false; |
|
|
|
} |