diff --git a/build/test/out/c/casualQuiz.o b/build/test/out/c/casualQuiz.o index 0f743cd..20bdd9f 100644 Binary files a/build/test/out/c/casualQuiz.o and b/build/test/out/c/casualQuiz.o differ diff --git a/build/test/out/test_casualQuiz.out b/build/test/out/test_casualQuiz.out index 2c3e15e..82e74bf 100755 Binary files a/build/test/out/test_casualQuiz.out and b/build/test/out/test_casualQuiz.out differ diff --git a/build/test/results/test_casualQuiz.pass b/build/test/results/test_casualQuiz.pass index 3735c59..44a3e59 100644 --- a/build/test/results/test_casualQuiz.pass +++ b/build/test/results/test_casualQuiz.pass @@ -61,4 +61,4 @@ - Right Answer, well done. - Wrong Input! - Wrong Input! -:time: 0.03427539998665452 +:time: 0.0355944000184536 diff --git a/build/test/results/test_quizduell.pass b/build/test/results/test_quizduell.pass index a0c8f10..e9adfd5 100644 --- a/build/test/results/test_quizduell.pass +++ b/build/test/results/test_quizduell.pass @@ -11,4 +11,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.013956899987533689 +:time: 0.014935399987734854 diff --git a/build/test/results/test_timequiz.pass b/build/test/results/test_timequiz.pass index 992f361..c1e676a 100644 --- a/build/test/results/test_timequiz.pass +++ b/build/test/results/test_timequiz.pass @@ -11,4 +11,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.018729900009930134 +:time: 0.017270599957555532 diff --git a/build/test/results/test_wwm.pass b/build/test/results/test_wwm.pass index 0ea587d..b0d898e 100644 --- a/build/test/results/test_wwm.pass +++ b/build/test/results/test_wwm.pass @@ -11,4 +11,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.01555840001674369 +:time: 0.015941800025757402 diff --git a/src/casualQuiz.c b/src/casualQuiz.c index a27ee61..f03c10a 100644 --- a/src/casualQuiz.c +++ b/src/casualQuiz.c @@ -21,7 +21,7 @@ void casualQuiz() { {"The End", "The Termination", "Pizza's ready", "Hotdog Time"}, {"12-Pack", "6-Pack", "Family Pack", "One-Pack"}, {"Metal", "Plastic", "Humans", "Water"}, - + }; int easy_richtigeAntworten[] = { 3,4,1,2,1 }; // int, um die jeweils richtige antwort zu zeigen @@ -32,8 +32,8 @@ void casualQuiz() { int* answeredP = &answered; bool already_played = false; bool end = false; - while (end == false){ - activePlaying(easy_fragen, *easy_antworten, easy_richtigeAntworten, length_frag_array, answeredP, correctP); + while (end == false) { + already_played = activePlaying(easy_fragen, *easy_antworten, easy_richtigeAntworten, length_frag_array, answeredP, correctP); printf("korrekte Antworten: %d\n", correct); printf("bei: %d beantworteten Fragen", answered); correct = 0; @@ -41,7 +41,7 @@ void casualQuiz() { } return; } -void activePlaying(char* fragen[], char* antworten[], int richtige_antwort[], int size, int* answeredP, int* correctP) { +bool activePlaying(char* fragen[], char* antworten[], int richtige_antwort[], int size, int* answeredP, int* correctP) { int eingabe; bool richtig; for (int i = 0; i < size; i++) { @@ -56,6 +56,7 @@ void activePlaying(char* fragen[], char* antworten[], int richtige_antwort[], in printf("Bool richtig / falsch: %d\n", richtig); printf(" %d\n", richtige_antwort[i]); } + return true; } void FzeigeFragen(char* fragen[], int index) { printf("Question: %s\n", fragen[index]); diff --git a/src/casualQuiz.h b/src/casualQuiz.h index 63507a9..8fd17e2 100644 --- a/src/casualQuiz.h +++ b/src/casualQuiz.h @@ -2,11 +2,11 @@ #define CASUALQUIZ_H void casualQuiz(); -void activePlaying(char *fragen[], char *antworten[], int richtige_antwort[], int size, int *answeredP, int *correctP ); -void FzeigeFragen(char *fragen[], int index); -void FzeigeAntworten(char *antworten[], int index); +bool activePlaying(char* fragen[], char* antworten[], int richtige_antwort[], int size, int* answeredP, int* correctP); +void FzeigeFragen(char* fragen[], int index); +void FzeigeAntworten(char* antworten[], int index); int FEingabeInteger(); -bool FcheckaufRichtigkeit(int eingabe, int richtige_antwort[],int i); +bool FcheckaufRichtigkeit(int eingabe, int richtige_antwort[], int i); void FzaehlernachAuswahl(bool richtig, int* answeredP, int* correctP); -#endif // ende CASUALQUIZ_H +#endif // ende CASUALQUIZ_H \ No newline at end of file