|
|
@ -19,11 +19,19 @@ void casualQuiz() { |
|
|
|
int easy_richtigeAntworten[] = { 3,4}; // int, um die jeweils richtige antwort zu zeigen |
|
|
|
|
|
|
|
int length_frag_array = sizeof(easy_richtigeAntworten)/sizeof(int); |
|
|
|
activePlaying(easy_fragen, *easy_antworten, easy_richtigeAntworten, length_frag_array); |
|
|
|
int correct = 0; |
|
|
|
int answered = 0; |
|
|
|
int *correctP = &correct; |
|
|
|
int *answeredP = &answered; |
|
|
|
|
|
|
|
activePlaying(easy_fragen, *easy_antworten, easy_richtigeAntworten, length_frag_array, answeredP, correctP); |
|
|
|
printf("%d", answered); |
|
|
|
return; |
|
|
|
} |
|
|
|
void activePlaying(char *fragen[], char *antworten[], int richtige_antwort[], int size ){ |
|
|
|
void activePlaying(char *fragen[], char *antworten[], int richtige_antwort[], int size, int *answeredP, int *correctP ){ |
|
|
|
int eingabe; |
|
|
|
int plus = *answeredP +1; |
|
|
|
*answeredP = plus; |
|
|
|
for (int i = 0; i < size; i++){ |
|
|
|
eingabe = 5; |
|
|
|
FzeigeFragen(fragen, i); |
|
|
@ -33,19 +41,19 @@ void activePlaying(char *fragen[], char *antworten[], int richtige_antwort[], in |
|
|
|
switch(eingabe){ |
|
|
|
case 1:{ |
|
|
|
printf("Case 1\n"); |
|
|
|
if (richtige_antwort[i] == 4) printf("Right Answer, well done.\n"); |
|
|
|
if (richtige_antwort[i] == 1) printf("Right Answer, well done.\n"); |
|
|
|
else printf("Wrong answer."); |
|
|
|
break; |
|
|
|
} |
|
|
|
case 2:{ |
|
|
|
printf("Case 2\n"); |
|
|
|
if (richtige_antwort[i] == 4) printf("Right Answer, well done.\n"); |
|
|
|
if (richtige_antwort[i] == 2) printf("Right Answer, well done.\n"); |
|
|
|
else printf("Wrong answer."); |
|
|
|
break; |
|
|
|
} |
|
|
|
case 3:{ |
|
|
|
printf("Case 3\n"); |
|
|
|
if (richtige_antwort[i] == 4) printf("Right Answer, well done.\n"); |
|
|
|
if (richtige_antwort[i] == 3) printf("Right Answer, well done.\n"); |
|
|
|
else printf("Wrong answer."); |
|
|
|
break; |
|
|
|
} |
|
|
|