I'm currently trying to create a game of Craps, and I am trying to display the message "Sorry. You busted!" after the user's balance goes to 0 in that round if they lose, and this is in C#. A part of the code is listed below in which where I believe this line can be entered (if you can't do C#, please reject my question). if (gameStatus == Status.Won) { Console.WriteLine("Wow! You win."); balance = balance + wager; Console.WriteLine("Current Balance => " + balance); } else { Console.WriteLine("Oh! You lose."); balance = balance - wager; Console.WriteLine("Current Balance => " + balance); wager = Convert.ToInt32(Console.ReadLine()); if (balance <= 0 || wager == 0) { Console.WriteLine("Sorry. You busted!"); break; }
I'm currently trying to create a game of Craps, and I am trying to display the message "Sorry. You busted!" after the user's balance goes to 0 in that round if they lose, and this is in C#. A part of the code is listed below in which where I believe this line can be entered (if you can't do C#, please reject my question).
if (gameStatus == Status.Won)
{
Console.WriteLine("Wow! You win.");
balance = balance + wager;
Console.WriteLine("Current Balance => " + balance);
}
else
{
Console.WriteLine("Oh! You lose.");
balance = balance - wager;
Console.WriteLine("Current Balance => " + balance);
wager = Convert.ToInt32(Console.ReadLine());
if (balance <= 0 || wager == 0)
{
Console.WriteLine("Sorry. You busted!");
break;
}
Step by step
Solved in 2 steps