Browse Source

refactoring: Funktion getBalanceBJ verständlicher umgeschrieben

remotes/origin/stefan
fdai7472 11 months ago
parent
commit
0f3a5e811f
  1. 8
      src/main/c/Stefan/blackjack.c

8
src/main/c/Stefan/blackjack.c

@ -6,13 +6,12 @@
int blackjack(){
printf("Welcome to Blackjack \n");
printf("Welcome to Blackjack \n\n");
int balance = getBalanceBJ();
while(balance > 0){
printf("Guthaben: %d\n", balance);
printf("Aktuelles Guthaben: %d\n", balance);
int bet = getBetBJ(balance);
balance -= bet;
@ -23,9 +22,8 @@ int blackjack(){
}
int getBalanceBJ(){
int balance = 0;
printf("Guthaben einwerfen: ");
scanf("%d", &balance);
int balance = userInputBJ();
printf("Dein Guthaben: %d\n", balance);
return balance;
}

Loading…
Cancel
Save