|
|
@ -8,6 +8,8 @@ int blackjack(){ |
|
|
|
printf("Welcome to Blackjack \n"); |
|
|
|
|
|
|
|
int balance = getBalanceBJ(); |
|
|
|
int bet = getBetBJ(balance); |
|
|
|
printf("bet: %d\n", bet); |
|
|
|
|
|
|
|
return 0; |
|
|
|
} |
|
|
@ -16,6 +18,27 @@ int getBalanceBJ(){ |
|
|
|
int balance = 0; |
|
|
|
printf("Guthaben einwerfen: "); |
|
|
|
scanf("%d", &balance); |
|
|
|
printf("Dein Guthaben: %d", balance); |
|
|
|
printf("Dein Guthaben: %d\n", balance); |
|
|
|
return balance; |
|
|
|
} |
|
|
|
|
|
|
|
int getBetBJ(int balance){ |
|
|
|
|
|
|
|
while(1){ |
|
|
|
printf("Wetteinsatz: "); |
|
|
|
int bet = userInputBJ(); |
|
|
|
|
|
|
|
if(bet <= balance && bet > 0){ |
|
|
|
return bet; |
|
|
|
} else { |
|
|
|
printf("Ungueltige Eingabe!\n"); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
int userInputBJ(){ |
|
|
|
int input; |
|
|
|
scanf("%d", &input); |
|
|
|
return input; |
|
|
|
} |