From a0f27247c4ac765c43b06b382a070c130e919166 Mon Sep 17 00:00:00 2001 From: fdai7472 Date: Mon, 29 Jan 2024 18:00:51 +0100 Subject: [PATCH] Guthaben wird nach jeder Runde angezeigt --- src/main/c/Stefan/slot_machine.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/c/Stefan/slot_machine.c b/src/main/c/Stefan/slot_machine.c index a779776..114583d 100644 --- a/src/main/c/Stefan/slot_machine.c +++ b/src/main/c/Stefan/slot_machine.c @@ -15,8 +15,6 @@ void slotMachine(){ int bet = getBet(balance); balance = subtractBetFromBalance(bet, balance); - printf("Guthaben: %d\n", balance); - randomizeSymbols(symbols); spin(symbols, bet, balance); @@ -89,8 +87,10 @@ void randomizeSymbols(char symbols[]){ int spin(char symbols[], int bet, int balance){ showResult(symbols); - int winnings = getWinnings(symbols, bet); + int winnings = getWinnings(symbols, bet); + balance += winnings; + printf("Aktuelles Guthaben: %d\n-------------------------\n", balance); return balance; }