From 95e648dd9532a88d6f29251ae614bc2d1bf34de6 Mon Sep 17 00:00:00 2001 From: Florian Baeseler Date: Mon, 5 Feb 2024 20:05:56 +0100 Subject: [PATCH] Switch erstellt um eingabe der Antwort auszuwerten --- 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/casualQuiz.c | 28 ++++++++++++++++++++++--- 5 files changed, 29 insertions(+), 7 deletions(-) diff --git a/build/test/results/test_casualQuiz.pass b/build/test/results/test_casualQuiz.pass index 499d0cc..3fa8184 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.015329999994719401 +:time: 0.013744500000029802 diff --git a/build/test/results/test_quizduell.pass b/build/test/results/test_quizduell.pass index c63dd7b..38b27f6 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.014142300002276897 +:time: 0.01369590000831522 diff --git a/build/test/results/test_timequiz.pass b/build/test/results/test_timequiz.pass index fbbb530..8e182a5 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.013569900009315461 +:time: 0.012676399986958131 diff --git a/build/test/results/test_wwm.pass b/build/test/results/test_wwm.pass index c3984b0..c0264ea 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.013188799988711253 +:time: 0.013807800016365945 diff --git a/src/casualQuiz.c b/src/casualQuiz.c index b80b77f..6f65e61 100644 --- a/src/casualQuiz.c +++ b/src/casualQuiz.c @@ -23,13 +23,35 @@ void casualQuiz() { return; } void activePlaying(char *fragen[], char *antworten[], int richtige_antwort[], int size ){ - int eingabeInt; + int eingabe; for (int i = 0; i < size; i++){ - eingabeInt = 5; + eingabe = 5; FzeigeFragen(fragen, i); FzeigeAntworten(antworten, i); printf("Please type in your answer 1,2,3 or 4: "); - + eingabe = FEingabeInteger(); + switch(eingabe){ + case 1:{ + printf("Case 1"); + break; + } + case 2:{ + printf("Case 2"); + break; + } + case 3:{ + printf("Case 3"); + break; + } + case 4:{ + printf("Case 4"); + break; + } + default:{ + printf("Default"); + break; + } + } printf(" %d\n", richtige_antwort[i]); } }