Browse Source

refactoring: Auslagern der Zähler, für mehr übersicht im Code

remotes/origin/Florian
Florian Baeseler 11 months ago
parent
commit
d58d71ddd1
  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. 24
      src/casualQuiz.c
  8. 1
      src/casualQuiz.h

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.
- Wrong Input!
- Wrong Input!
:time: 0.034674599999561906
:time: 0.03563229998690076

2
build/test/results/test_quizduell.pass

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

2
build/test/results/test_timequiz.pass

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

2
build/test/results/test_wwm.pass

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

24
src/casualQuiz.c

@ -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;
}

1
src/casualQuiz.h

@ -7,5 +7,6 @@ void FzeigeFragen(char *fragen[], int index);
void FzeigeAntworten(char *antworten[], int index);
int FEingabeInteger();
bool FcheckaufRichtigkeit(int eingabe, int richtige_antwort[],int i);
void FzaehlernachAuswahl(bool richtig, int* answeredP, int* correctP);
#endif // ende CASUALQUIZ_H
Loading…
Cancel
Save