diff --git a/src/wwm.c b/src/wwm.c index 2d7bffc..b987eca 100644 --- a/src/wwm.c +++ b/src/wwm.c @@ -31,6 +31,10 @@ void ccheckAnswer(int useranswer) { printf("Congratulations! You have won %d $!", geld); exit(0); } + if (useranswer < 1 || useranswer > 4) { + printf("Please enter a number beetween 1 and 4 or enter 5 to end the game!\n"); + ceingabe(); + } } int ceingabe() { @@ -40,7 +44,8 @@ int ceingabe() { printf("Please enter a number beetween 1 and 4 to answer or 5 to end the game!\n"); while (getchar() != '\n') return ceingabe(); - return useranswer; + ccheckAnswer(useranswer); + return useranswer; } };