bankroll:
TextWindow.Write("How Much Do You Have: ")
cash = TextWindow.ReadNumber()
bet()
Sub bet
If(cash = 0)Then
TextWindow.WriteLine("You are Bankrupt")
TextWindow.PauseWithoutMessage()
Program.End()
Endif
TextWindow.Write("Bet How Much: ")
PlacedBet = TextWindow.ReadNumber()
If(PlacedBet > cash)Then
TextWindow.WriteLine("You have insufficient cash")
bet()
endif
d1 = Math.GetRandomNumber(6)
d2 = Math.GetRandomNumber(6)
diceroll = d1 + d2
TextWindow.WriteLine("Rolling Dice...")
If diceroll = 7 Or diceroll = 11 then
Won()
Else
Lost()
EndIf
EndSub
Sub Won
TextWindow.Write("You Rolled " + diceroll)
TextWindow.WriteLine(" and won!")
cash = cash + PlacedBet*5
TextWindow.WriteLine("You now have $" + cash)
bet()
EndSub
Sub Lost
TextWindow.Write("You Rolled " + diceroll)
TextWindow.WriteLine(" and lost!")
cash = cash - PlacedBet
TextWindow.WriteLine("You now have $" + cash)
bet()
EndSub