diff --git a/build/test/out/c/quizduell.o b/build/test/out/c/quizduell.o index 628be8d..b58391d 100644 Binary files a/build/test/out/c/quizduell.o and b/build/test/out/c/quizduell.o differ diff --git a/build/test/out/test_quizduell.out b/build/test/out/test_quizduell.out index c790c1d..8cf7412 100755 Binary files a/build/test/out/test_quizduell.out and b/build/test/out/test_quizduell.out differ diff --git a/build/test/results/test_casualQuiz.pass b/build/test/results/test_casualQuiz.pass index 745d4a3..c1ff0ed 100644 --- a/build/test/results/test_casualQuiz.pass +++ b/build/test/results/test_casualQuiz.pass @@ -11,4 +11,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.016226099999812504 +:time: 0.01736479999999574 diff --git a/build/test/results/test_quizduell.pass b/build/test/results/test_quizduell.pass index 6c89c6a..c4c5b9c 100644 --- a/build/test/results/test_quizduell.pass +++ b/build/test/results/test_quizduell.pass @@ -15,4 +15,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.030707300000131 +:time: 0.03556579999985843 diff --git a/build/test/results/test_timequiz.pass b/build/test/results/test_timequiz.pass index d3eac8c..eb8593a 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.016036299999996118 +:time: 0.01705069999979969 diff --git a/build/test/results/test_wwm.pass b/build/test/results/test_wwm.pass index fc813b8..a6a99ee 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.016368800000009287 +:time: 0.01840379999975994 diff --git a/src/quizduell.c b/src/quizduell.c index b152973..0048a09 100644 --- a/src/quizduell.c +++ b/src/quizduell.c @@ -31,21 +31,30 @@ int spieleKategorie(Kategorie* kategorie) { 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; }