diff --git a/main.cpp b/main.cpp index bc6eb76..321f9b9 100644 --- a/main.cpp +++ b/main.cpp @@ -24,12 +24,17 @@ int balance = 0; int bank_balance = 10000; int save_depo = 0; +void display_balance(){ + cout << "Your current casino balance: " << balance << " NyscoCoins" << endl; +} + void coinflip() { srand(time(0)); // Seed the random number generator int bet_amount; char user_choice; + display_balance(); cout << "Enter the amount of money you want to bet on the coin flip: "; cin >> bet_amount; @@ -103,6 +108,7 @@ void slots() { int bet_amount; char end_choice; + display_balance(); cout << "Enter the amount of money you want to bet on slots: "; cin >> bet_amount; @@ -163,6 +169,7 @@ void blackjack() { cout << "Your cards: " << playerCard1 << " and " << playerCard2 << " (Total: " << playerTotal << ")" << endl; cout << "Dealer's visible card: " << dealerCard1 << endl; + display_balance(); cout << "Enter your bet amount: "; cin >> bet_amount; @@ -233,6 +240,7 @@ void diceRoll() { int bet_amount, outcome; char end_choice; + display_balance(); cout << "Enter the amount of money you want to bet on dice roll: "; cin >> bet_amount; @@ -291,6 +299,7 @@ void higherOrLower() { char outcome; char end_choice; + display_balance(); cout << "Enter the amount of money you want to bet on higer or lower: "; cin >> bet_amount; @@ -306,12 +315,6 @@ void higherOrLower() { higherOrLower(); } - if (outcome > 100 || outcome < 1) { - cout << "The range is from 1 to 100" << endl; - Sleep(3000); - higherOrLower(); - } - balance -= bet_amount; cout << "Generating the output number.." << endl;