|
|
@ -16,13 +16,13 @@ void casualQuiz() { |
|
|
|
{"Elsa", "Rapunzel", "Cinderella", "Pocahontas"}, |
|
|
|
{"Republicanism", "Liberalism", "Conservatism", "Communism"}, |
|
|
|
}; |
|
|
|
int easy_richtigeAntworten[] = { 3,4}; // int, um die jeweils richtige antwort zu zeigen |
|
|
|
int easy_richtigeAntworten[] = { 3,4 }; // int, um die jeweils richtige antwort zu zeigen |
|
|
|
|
|
|
|
int length_frag_array = sizeof(easy_richtigeAntworten)/sizeof(int); |
|
|
|
int length_frag_array = sizeof(easy_richtigeAntworten) / sizeof(int); |
|
|
|
int correct = 0; |
|
|
|
int answered = 0; |
|
|
|
int *correctP = &correct; |
|
|
|
int *answeredP = &answered; |
|
|
|
int* correctP = &correct; |
|
|
|
int* answeredP = &answered; |
|
|
|
|
|
|
|
activePlaying(easy_fragen, *easy_antworten, easy_richtigeAntworten, length_frag_array, answeredP, correctP); |
|
|
|
printf("korrekte Antworten: %d\n", correct); |
|
|
@ -40,16 +40,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); |
|
|
|
if (richtig == true){ |
|
|
|
int plus = *answeredP + 1; |
|
|
|
*answeredP = plus; |
|
|
|
int add = *correctP + 1; |
|
|
|
*correctP = add; |
|
|
|
} |
|
|
|
else{ |
|
|
|
int plus = *answeredP + 1; |
|
|
|
*answeredP = plus; |
|
|
|
} |
|
|
|
FzaehlernachAuswahl(richtig, answeredP, correctP); |
|
|
|
printf("Bool richtig / falsch: %d\n", richtig); |
|
|
|
printf(" %d\n", richtige_antwort[i]); |
|
|
|
} |
|
|
@ -114,3 +105,16 @@ bool FcheckaufRichtigkeit(int eingabe, int richtige_antwort[], int i) { |
|
|
|
} |
|
|
|
return false; |
|
|
|
} |
|
|
|
void FzaehlernachAuswahl(bool richtig, int* answeredP, int* correctP) { |
|
|
|
if (richtig == true) { |
|
|
|
int plus = *answeredP + 1; |
|
|
|
*answeredP = plus; |
|
|
|
int add = *correctP + 1; |
|
|
|
*correctP = add; |
|
|
|
} |
|
|
|
else { |
|
|
|
int plus = *answeredP + 1; |
|
|
|
*answeredP = plus; |
|
|
|
} |
|
|
|
return; |
|
|
|
} |