From 69547c2b79fa2745117d5ad7c07f5c41aaad1580 Mon Sep 17 00:00:00 2001 From: Michael Pilosov Date: Sun, 27 Nov 2022 02:51:33 -0700 Subject: [PATCH] change dynamic to use decimals --- index.html | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index 5687bb4..2cb662f 100644 --- a/index.html +++ b/index.html @@ -42,17 +42,19 @@ import pyroulette as pr # seed(59) -from random import randint +from random import random, randint + players = [] for _ in range(1, 20): - c = randint(0, 3) - if c == 0: - min_games = randint(1, 100) - elif c == 1: - min_games = randint(1, 25) - else: - min_games = randint(1, 2) + c = random() + if c < 0.5: # half our players want to play 50-100 games + min_games = randint(50, 100) + elif c < 0.8: # 30% want to play 25-50 games + min_games = randint(25, 50) + else: # the rest are fine with going home very early. + min_games = randint(1, 10) + min_games = 100 # this caps out at about 250 games. need to bet bigger to win bigger. players.extend(pr.generate_players(num_players=50, min_num_games=min_games, total_budget=100)) players = pr.play_roulette(players, games=100)