|
@ -7,7 +7,12 @@ void slotMachine(){ |
|
|
|
|
|
|
|
|
int balance = getBalance(); |
|
|
int balance = getBalance(); |
|
|
|
|
|
|
|
|
|
|
|
while(balance > 0){ |
|
|
|
|
|
|
|
|
|
|
|
int bet = getBet(balance); |
|
|
|
|
|
balance -= bet; |
|
|
|
|
|
printf("%d\n", balance); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -18,7 +23,7 @@ int getBalance(){ |
|
|
int balance; |
|
|
int balance; |
|
|
printf("Guthaben einwerfen: "); |
|
|
printf("Guthaben einwerfen: "); |
|
|
balance = userInput(); |
|
|
balance = userInput(); |
|
|
printf("Dein Guthaben: %d", balance); |
|
|
|
|
|
|
|
|
printf("Dein Guthaben: %d\n", balance); |
|
|
return balance; |
|
|
return balance; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -28,6 +33,14 @@ int userInput(){ |
|
|
return input; |
|
|
return input; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int getBet(int balance){ |
|
|
|
|
|
int bet; |
|
|
|
|
|
printf("Wetteinsatz: "); |
|
|
|
|
|
bet = userInput(); |
|
|
|
|
|
|
|
|
|
|
|
return bet; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void welcomeMessage(){ |
|
|
void welcomeMessage(){ |
|
|
printf("Herzlich Willkommen zur \n\n" |
|
|
printf("Herzlich Willkommen zur \n\n" |
|
|
" _ _ _ _ \n" |
|
|
" _ _ _ _ \n" |
|
|