From a8e715f97d09f343ae6768506f60a41b54d8e95a Mon Sep 17 00:00:00 2001 From: Kevin Schellberg Date: Sun, 4 Feb 2024 19:07:41 +0100 Subject: [PATCH] Kategorie2 --- src/quizduell.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/quizduell.c b/src/quizduell.c index 11af694..0e94d9e 100644 --- a/src/quizduell.c +++ b/src/quizduell.c @@ -19,6 +19,7 @@ QuizFrage erstelleFrage(const char* frage, const char* antwortA, const char* ant 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"); } void quizduell() { @@ -30,6 +31,13 @@ void quizduell() { kategorien[0].anzahlFragen = MAX_QUESTIONS_PER_CATEGORY; kategorien[0].joker = 1; + kategorien[1].fragen = (QuizFrage*)malloc(MAX_QUESTIONS_PER_CATEGORY * sizeof(QuizFrage)); + kategorien[1].fragen[0] = erstelleFrage("Which Ingredient is used traditionally for Pesto?", "Tomatoes", "Basil", "Spinach", "Oregano", 'B'); + kategorien[1].fragen[1] = erstelleFrage("Which meal is known for its usage of rice?", "Lasagna", "Sushi", "Pizza", "Hamburger", 'B'); + kategorien[1].fragen[2] = erstelleFrage("Which color has a ripe banana?", "Red", "Green", "Yellow", "Orange", 'C'); + kategorien[1].anzahlFragen = MAX_QUESTIONS_PER_CATEGORY; + kategorien[1].joker = 1; + while (1) { char auswahl[50];