Browse Source

AbfrageObJokerBenutzen

remotes/origin/Kevin
Kevin Schellberg 11 months ago
parent
commit
7bc651f7b5
  1. BIN
      build/test/out/c/quizduell.o
  2. BIN
      build/test/out/test_quizduell.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. 33
      src/quizduell.c

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

BIN
build/test/out/test_quizduell.out

2
build/test/results/test_casualQuiz.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.016226099999812504
:time: 0.01736479999999574

2
build/test/results/test_quizduell.pass

@ -15,4 +15,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.030707300000131
:time: 0.03556579999985843

2
build/test/results/test_timequiz.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.016036299999996118
:time: 0.01705069999979969

2
build/test/results/test_wwm.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.016368800000009287
:time: 0.01840379999975994

33
src/quizduell.c

@ -31,21 +31,30 @@ int spieleKategorie(Kategorie* kategorie) {
char jokerAntwort[10]; char jokerAntwort[10];
printf("\nA) %s\nB) %s\nC) %s\nD) %s\n", kategorie->fragen[i].antwortA, kategorie->fragen[i].antwortB, kategorie->fragen[i].antwortC, kategorie->fragen[i].antwortD);
do {
printf("\nA) %s\nB) %s\nC) %s\nD) %s\n", kategorie->fragen[i].antwortA, kategorie->fragen[i].antwortB, kategorie->fragen[i].antwortC, kategorie->fragen[i].antwortD);
printf("Your answer: ");
scanf("%s", benutzerAntwort);
if (!jokerVerwendet) {
printf("\nDo you want to use the joker? (Y/N): ");
scanf("%s", jokerAntwort);
printf(jokerAntwort);
}
benutzerAntwort[0] = toupper(benutzerAntwort[0]);
getchar();
printf("Your answer: ");
scanf("%s", benutzerAntwort);
if (pruefeAntwort(kategorie->fragen[i], benutzerAntwort[0])) {
printf("Correct!\n");
punktzahl++;
}
else {
printf("Wrong! The correct Answer is %c\n", kategorie->fragen[i].korrekteAntwort);
}
benutzerAntwort[0] = toupper(benutzerAntwort[0]);
getchar();
if (pruefeAntwort(kategorie->fragen[i], benutzerAntwort[0])) {
printf("Correct!\n");
punktzahl++;
}
else {
printf("Wrong! The correct Answer is %c\n", kategorie->fragen[i].korrekteAntwort);
}
} while (0);
} }
return punktzahl; return punktzahl;
} }

Loading…
Cancel
Save