Browse Source

Zählervariablen werden mitgezählt je nach richtig oder falsch

remotes/origin/Florian
Florian Baeseler 11 months ago
parent
commit
e072c4c51e
  1. BIN
      build/test/out/c/casualQuiz.o
  2. BIN
      build/test/out/test_casualQuiz.out
  3. 2
      build/test/results/test_casualQuiz.pass
  4. 2
      build/test/results/test_quizduell.pass
  5. 2
      build/test/results/test_timequiz.pass
  6. 2
      build/test/results/test_wwm.pass
  7. 15
      src/casualQuiz.c

BIN
build/test/out/c/casualQuiz.o

BIN
build/test/out/test_casualQuiz.out

2
build/test/results/test_casualQuiz.pass

@ -45,4 +45,4 @@
- Right Answer, well done. - Right Answer, well done.
- Wrong Input! - Wrong Input!
- Wrong Input! - Wrong Input!
:time: 0.03493439999874681
:time: 0.034674599999561906

2
build/test/results/test_quizduell.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.014303199975984171
:time: 0.013722000003326684

2
build/test/results/test_timequiz.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.014138700003968552
:time: 0.013790600001811981

2
build/test/results/test_wwm.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.01387090000207536
:time: 0.014121699990937486

15
src/casualQuiz.c

@ -25,13 +25,12 @@ void casualQuiz() {
int *answeredP = &answered; int *answeredP = &answered;
activePlaying(easy_fragen, *easy_antworten, easy_richtigeAntworten, length_frag_array, answeredP, correctP); activePlaying(easy_fragen, *easy_antworten, easy_richtigeAntworten, length_frag_array, answeredP, correctP);
printf("%d", answered);
printf("korrekte Antworten: %d\n", correct);
printf("bei: %d beantworteten Fragen", answered);
return; return;
} }
void activePlaying(char* fragen[], char* antworten[], int richtige_antwort[], int size, int* answeredP, int* correctP) { void activePlaying(char* fragen[], char* antworten[], int richtige_antwort[], int size, int* answeredP, int* correctP) {
int eingabe; int eingabe;
int plus = *answeredP + 1;
*answeredP = plus;
bool richtig; bool richtig;
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
eingabe = 5; 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: "); printf("Please type in your answer 1,2,3 or 4: ");
eingabe = FEingabeInteger(); eingabe = FEingabeInteger();
richtig = FcheckaufRichtigkeit(eingabe, richtige_antwort, i); 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("Bool richtig / falsch: %d\n", richtig);
printf(" %d\n", richtige_antwort[i]); printf(" %d\n", richtige_antwort[i]);
} }

Loading…
Cancel
Save