diff --git a/src/wwm.c b/src/wwm.c index 1f705f8..ee223e8 100644 --- a/src/wwm.c +++ b/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; } } - } }