Browse Source

Überprüfung der Eingabe in Switch mit wahr/falsch ausgabe

remotes/origin/Florian
Florian Baeseler 11 months ago
parent
commit
886f0ece64
  1. 2
      build/test/results/test_casualQuiz.pass
  2. 2
      build/test/results/test_quizduell.pass
  3. 2
      build/test/results/test_timequiz.pass
  4. 2
      build/test/results/test_wwm.pass
  5. 18
      src/casualQuiz.c

2
build/test/results/test_casualQuiz.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.013744500000029802
:time: 0.013265200017485768

2
build/test/results/test_quizduell.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.01369590000831522
:time: 0.013494899991201237

2
build/test/results/test_timequiz.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.012676399986958131
:time: 0.012791300017852336

2
build/test/results/test_wwm.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.013807800016365945
:time: 0.013431600003968924

18
src/casualQuiz.c

@ -32,23 +32,31 @@ void activePlaying(char *fragen[], char *antworten[], int richtige_antwort[], in
eingabe = FEingabeInteger(); eingabe = FEingabeInteger();
switch(eingabe){ switch(eingabe){
case 1:{ case 1:{
printf("Case 1");
printf("Case 1\n");
if (richtige_antwort[i] == 4) printf("Right Answer, well done.\n");
else printf("Wrong answer.");
break; break;
} }
case 2:{ case 2:{
printf("Case 2");
printf("Case 2\n");
if (richtige_antwort[i] == 4) printf("Right Answer, well done.\n");
else printf("Wrong answer.");
break; break;
} }
case 3:{ case 3:{
printf("Case 3");
printf("Case 3\n");
if (richtige_antwort[i] == 4) printf("Right Answer, well done.\n");
else printf("Wrong answer.");
break; break;
} }
case 4:{ case 4:{
printf("Case 4");
printf("Case 4\n");
if (richtige_antwort[i] == 4) printf("Right Answer, well done.\n");
else printf("Wrong answer.");
break; break;
} }
default:{ default:{
printf("Default");
printf("Wrong Input!");
break; break;
} }
} }

Loading…
Cancel
Save