Created
May 18, 2017 18:00
-
-
Save Hoffs/33fd243741d9256495f9ee2229c66a6f to your computer and use it in GitHub Desktop.
Double up doesn't work
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
allbank = 0 | |
alliter = 0 | |
allmax = 0 | |
itt = 0 | |
it = 10000 | |
for i in range(0, it): | |
itt += 1 | |
bank = 1024 | |
bet = 1 | |
maxb = bank | |
iteration_count = 0 | |
while bank > bet: | |
iteration_count += 1 | |
bank -= bet | |
if random.randint(1, 37) <= 16: | |
bank = bank + (bet * 2) | |
bet = 1; | |
else: | |
bet = bet * 2 | |
if bank > maxb: | |
maxb = bank | |
alliter += iteration_count | |
allbank += bank | |
allmax += maxb | |
print(itt) | |
print(allbank/it) | |
print(alliter/it) | |
print(allmax/it) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment