diff --git a/src/main/c/Stefan/slot_machine.c b/src/main/c/Stefan/slot_machine.c index dfddd13..4d1e33f 100644 --- a/src/main/c/Stefan/slot_machine.c +++ b/src/main/c/Stefan/slot_machine.c @@ -34,11 +34,17 @@ int userInput(){ } int getBet(int balance){ - int bet; - printf("Wetteinsatz: "); - bet = userInput(); - return bet; + while(1){ + printf("Wetteinsatz: "); + int bet = userInput(); + + if(bet <= balance && bet >= 0){ + return bet; + } else { + printf("Ungueltige Eingabe!\n"); + } + } } void welcomeMessage(){