import random
bankRoll = 100000
constBankRoll = bankRoll
bigRoll = bankRoll
handCounter = 0
betSize = 1
constBetSize = betSize
bigBet = betSize
handsAnHour = 109
winning = False
print("Your bankroll is", constBankRoll," you are betting", betSize ," a hand"
while bankRoll > 0:
winning = False
if random.random() > .49 :
bankRoll -= betSize
else:
bankRoll += betSize
winning = True
if bankRoll > bigRoll:
bigRoll = bankRoll
if winning == False:
betSize = betSize * 2
if bankRoll >= constBankRoll:
betSize = constBetSize
if betSize > bigBet:
bigBet = betSize
#print(bankRoll)
handCounter += 1
hoursToBust = handCounter / handsAnHour
print("The highest your bankroll reached was:", bigRoll)
print("The number of hands it took for you to go broke was", handCounter)
print("assuming", handsAnHour," hands an hour it would have taken", hoursToBust ," hours for you to go busto"
print("The casino made", constBankRoll / hoursToBust, " dollars an hour"
print("The largest betsizing you made was", bigBet/2,)