Browse Source

functional 16: Implementierung eingabe()

remotes/origin/Christian
Christian Reum 11 months ago
parent
commit
d67e753fb7
  1. 15
      src/wwm.c

15
src/wwm.c

@ -22,7 +22,10 @@ int crandomNumber() {
}
int ceingabe() {
scanf("%d", &useranswer);
return useranswer;
};
void wwm(){
@ -74,10 +77,9 @@ void wwm(){
for (int i = 0; i < 4; i++) {
printf("%d. %s \n", i + 1, answers[frage][i]);
int useranswer;
printf("Your answer (1-4):");
scanf("%d", &useranswer);
}
printf("Your answer (1-4):");
ceingabe();
if (useranswer == correctAnswer[frage]) {
@ -86,9 +88,8 @@ void wwm(){
setGeld(runde);
}
else {
printf("What a shame! That is wrong!\n You lost %d $", geld);
printf("That is a shame! That is wrong!\n You lost %d $", geld);
return;
}
}
}
}
Loading…
Cancel
Save