modify for linux

This commit is contained in:
nyosic 2025-02-08 00:30:46 +01:00
parent 933c9976e3
commit f12ed00c5a
2 changed files with 28 additions and 28 deletions

BIN
main Executable file

Binary file not shown.

View File

@ -53,15 +53,15 @@ void coinflip() {
// Check if the user won or lost
if ((user_choice == 'H' || user_choice == 'h') && flip_result == 0) {
system("cls");
system("clear");
cout << "Congratulations! You won! You get double the bet amount." << endl;
balance += 2 * bet_amount;
} else if ((user_choice == 'T' || user_choice == 't') && flip_result == 1) {
system("cls");
system("clear");
cout << "Congratulations! You won! You get double the bet amount." << endl;
balance += 2 * bet_amount;
} else {
system("cls");
system("clear");
cout << "Sorry! You lost the bet. Better luck next time!" << endl;
}
@ -71,10 +71,10 @@ void coinflip() {
cin >> end_choice;
if (end_choice == 'y' || end_choice == 'Y') {
system("cls");
system("clear");
coinflip();
} else {
system("cls");
system("clear");
}
}
@ -118,10 +118,10 @@ void slots() {
cin >> end_choice;
if (end_choice == 'y' || end_choice == 'Y') {
system("cls");
system("clear");
slots();
} else {
system("cls");
system("clear");
}
}
@ -190,10 +190,10 @@ void blackjack() {
cin >> end_choice;
if (end_choice == 'y' || end_choice == 'Y') {
system("cls");
system("clear");
blackjack();
} else {
system("cls");
system("clear");
}
}
@ -235,7 +235,7 @@ void diceRoll() {
cout << "You rolled: " << dice1 << " and " << dice2 << " (Total: " << total << ")" << endl;
if (total == 7) {
if (total == outcome) {
cout << "Congratulations! You won double your bet amount!" << endl;
balance += 2 * bet_amount;
} else {
@ -248,10 +248,10 @@ void diceRoll() {
cin >> end_choice;
if (end_choice == 'y' || end_choice == 'Y') {
system("cls");
system("clear");
diceRoll();
} else {
system("cls");
system("clear");
}
}
@ -267,16 +267,16 @@ void deposit() {
if (bank_balance >= deposit_amount) {
balance += deposit_amount;
bank_balance -= deposit_amount;
system("cls");
system("clear");
cout << "Deposit successful! Your new balance is: " << balance << " NyscoCoins"<< endl;
sleep(3);
system("cls");
system("clear");
}
else {
system("cls");
system("clear");
cout << "You don't have enough money in your bank account!" << endl;
sleep(3);
system("cls");
system("clear");
}
}
@ -287,16 +287,16 @@ void withdraw() {
if (balance >= withdraw_amount) {
balance -= withdraw_amount;
bank_balance += withdraw_amount;
system("cls");
system("clear");
cout << "Deposit successful! Your new balance is: " << balance << " NyscoCoins" << endl;
sleep(3);
system("cls");
system("clear");
}
else {
system("cls");
system("clear");
cout << "You don't have enough NyscoCoins to withdraw!" << endl;
sleep(3);
system("cls");
system("clear");
}
}
@ -335,35 +335,35 @@ int main() {
switch (game_choice) {
case 'C': case 'c':
system("cls");
system("clear");
coinflip();
break;
case 'S': case 's':
system("cls");
system("clear");
slots();
break;
case 'B': case 'b':
system("cls");
system("clear");
blackjack();
break;
case 'R': case 'r':
system("cls");
system("clear");
roulette();
break;
case 'D': case 'd':
system("cls");
system("clear");
diceRoll();
break;
case 'H': case 'h':
system("cls");
system("clear");
higherOrLower();
break;
case 'M': case 'm':
system("cls");
system("clear");
deposit();
break;
case 'W': case 'w':
system("cls");
system("clear");
withdraw();
break;
case 'Q': case 'q':