diff --git a/build/test/out/c/casualQuiz.o b/build/test/out/c/casualQuiz.o index 9c6495e..6db6dfd 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 e27a696..b7235ea 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 6607d70..0f88edb 100644 --- a/build/test/results/test_casualQuiz.pass +++ b/build/test/results/test_casualQuiz.pass @@ -45,4 +45,4 @@ - Right Answer, well done. - Wrong Input! - Wrong Input! -:time: 0.03493439999874681 +:time: 0.034674599999561906 diff --git a/build/test/results/test_quizduell.pass b/build/test/results/test_quizduell.pass index 64b243b..ff4134e 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.014303199975984171 +:time: 0.013722000003326684 diff --git a/build/test/results/test_timequiz.pass b/build/test/results/test_timequiz.pass index 2bee253..7957b2c 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.014138700003968552 +:time: 0.013790600001811981 diff --git a/build/test/results/test_wwm.pass b/build/test/results/test_wwm.pass index e449187..037c63a 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.01387090000207536 +:time: 0.014121699990937486 diff --git a/src/casualQuiz.c b/src/casualQuiz.c index 199e3c1..42a4ab1 100644 --- a/src/casualQuiz.c +++ b/src/casualQuiz.c @@ -18,20 +18,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); - int correct = 0; - int answered = 0; - int *correctP = &correct; - int *answeredP = &answered; + int length_frag_array = sizeof(easy_richtigeAntworten)/sizeof(int); + 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; + activePlaying(easy_fragen, *easy_antworten, easy_richtigeAntworten, length_frag_array, answeredP, correctP); + printf("korrekte Antworten: %d\n", correct); + printf("bei: %d beantworteten Fragen", answered); + return; } void activePlaying(char* fragen[], char* antworten[], int richtige_antwort[], int size, int* answeredP, int* correctP) { int eingabe; - int plus = *answeredP + 1; - *answeredP = plus; bool richtig; for (int i = 0; i < size; i++) { eingabe = 5; @@ -41,6 +40,16 @@ 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; + } printf("Bool richtig / falsch: %d\n", richtig); printf(" %d\n", richtige_antwort[i]); }