From 3c12a34368501141c55058aa95d842da31cb8faf Mon Sep 17 00:00:00 2001 From: Kevin Schellberg Date: Sun, 4 Feb 2024 19:09:34 +0100 Subject: [PATCH] Kategorie3 --- build/test/results/test_casualQuiz.pass | 2 +- build/test/results/test_quizduell.pass | 2 +- build/test/results/test_timequiz.pass | 2 +- build/test/results/test_wwm.pass | 2 +- src/quizduell.c | 8 ++++++++ 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/build/test/results/test_casualQuiz.pass b/build/test/results/test_casualQuiz.pass index 2dd9576..daff2bb 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.016109799999981078 +:time: 0.01711440000008224 diff --git a/build/test/results/test_quizduell.pass b/build/test/results/test_quizduell.pass index 9aa58e0..4c4270e 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.016670100000055754 +:time: 0.017044999999939137 diff --git a/build/test/results/test_timequiz.pass b/build/test/results/test_timequiz.pass index 62fd34d..be3b211 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.01621090000003278 +:time: 0.01672519999999622 diff --git a/build/test/results/test_wwm.pass b/build/test/results/test_wwm.pass index dbde2a6..8bdd9d6 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.01656690000004346 +:time: 0.016789599999924576 diff --git a/src/quizduell.c b/src/quizduell.c index 2de32be..5476c5a 100644 --- a/src/quizduell.c +++ b/src/quizduell.c @@ -20,6 +20,7 @@ void zeigeVerfuegbareKategorien(Kategorie kategorien[]) { printf("\nChoose a Category:\n"); if (kategorien[0].fragen != NULL) printf("Mountains\n"); if (kategorien[1].fragen != NULL) printf("Cooking\n"); + if (kategorien[2].fragen != NULL) printf("Sports\n"); } void quizduell() { @@ -40,6 +41,13 @@ void quizduell() { kategorien[1].anzahlFragen = MAX_QUESTIONS_PER_CATEGORY; kategorien[1].joker = 1; + kategorien[2].fragen = (QuizFrage*)malloc(MAX_QUESTIONS_PER_CATEGORY * sizeof(QuizFrage)); + kategorien[2].fragen[0] = erstelleFrage("In which sport is the term 'home run' used?", "Soccer/Football", "Baseball", "Tennis", "Golf", 'B'); + kategorien[2].fragen[1] = erstelleFrage("How many players are there normally on the pitch in a soccer/football team?", "9", "11", "7", "5", 'B'); + kategorien[2].fragen[2] = erstelleFrage("What sport is played on a pitch and has a 'wicket'?", "Rugby", "Cricket", "American Football", "Hockey", 'B'); + kategorien[2].anzahlFragen = MAX_QUESTIONS_PER_CATEGORY; + kategorien[2].joker = 1; + while (1) { char auswahl[50];