change dynamic to use decimals
This commit is contained in:
parent
857338ba5f
commit
69547c2b79
18
index.html
18
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)
|
||||
|
Loading…
Reference in New Issue
Block a user