Browse Source

refactoring: IntegerEingabe ausgelagert in eigene Funktion für weitere Verwendung anderorts

remotes/origin/Florian
Florian Baeseler 11 months ago
parent
commit
f08e594a40
  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. 7
      src/casualQuiz.c
  6. 1
      src/casualQuiz.h

2
build/test/results/test_casualQuiz.pass

@ -11,4 +11,4 @@
:failed: 0
:ignored: 0
:stdout: []
:time: 0.0403814000019338
:time: 0.015329999994719401

2
build/test/results/test_quizduell.pass

@ -11,4 +11,4 @@
:failed: 0
:ignored: 0
:stdout: []
:time: 0.03373009999631904
:time: 0.014142300002276897

2
build/test/results/test_timequiz.pass

@ -11,4 +11,4 @@
:failed: 0
:ignored: 0
:stdout: []
:time: 0.03012859998852946
:time: 0.013569900009315461

2
build/test/results/test_wwm.pass

@ -11,4 +11,4 @@
:failed: 0
:ignored: 0
:stdout: []
:time: 0.03110500000184402
:time: 0.013188799988711253

7
src/casualQuiz.c

@ -29,7 +29,7 @@ void activePlaying(char *fragen[], char *antworten[], int richtige_antwort[], in
FzeigeFragen(fragen, i);
FzeigeAntworten(antworten, i);
printf("Please type in your answer 1,2,3 or 4: ");
scanf_s("%d", &eingabeInt);
printf(" %d\n", richtige_antwort[i]);
}
}
@ -41,4 +41,9 @@ void FzeigeAntworten(char *antworten[], int index){
printf("2) %s\n", antworten[4 * index + 1]);
printf("3) %s\n", antworten[4 * index + 2]);
printf("4) %s\n", antworten[4 * index + 3]);
}
int FEingabeInteger(){
int eingabeInt;
scanf_s("%d", &eingabeInt);
return eingabeInt;
}

1
src/casualQuiz.h

@ -5,5 +5,6 @@ void casualQuiz();
void activePlaying(char *fragen[], char *antworten[], int richtige_antwort[], int size);
void FzeigeFragen(char *fragen[], int index);
void FzeigeAntworten(char *antworten[], int index);
int FEingabeInteger();
#endif // ende CASUALQUIZ_H
Loading…
Cancel
Save