64 lines
1.7 KiB
HTML
64 lines
1.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
|
|
|
<title>Roulette Demo</title>
|
|
|
|
<!-- <link rel="icon" type="image/png" href="favicon.png" /> -->
|
|
<link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css" />
|
|
|
|
<script defer src="https://pyscript.net/latest/pyscript.js"></script>
|
|
<link rel="stylesheet" href="./assets/css/examples.css" />
|
|
<link rel="stylesheet" href="./assets/prism/prism.css" />
|
|
<script defer src="./assets/prism/prism.js"></script>
|
|
</head>
|
|
|
|
<body>
|
|
<nav class="navbar" style="background-color: #000000;">
|
|
<div class="app-header">
|
|
<!-- <a href="/">
|
|
<img src="./logo.png" class="logo">
|
|
</a> -->
|
|
<a class="title" href="" style="color: #f0ab3c;">Roulette</a>
|
|
</div>
|
|
</nav>
|
|
<section class="pyscript">
|
|
<div class="font-mono">Simulating 100 Games for 500 Players: <label id="outputDiv"></label></div>
|
|
<div id="outputDiv2" class="font-mono"></div>
|
|
<div id="outputDiv3" class="font-mono"></div>
|
|
<py-config>
|
|
packages = [
|
|
"pyroulette",
|
|
]
|
|
</py-config>
|
|
<py-script>
|
|
from pyroulette import *
|
|
# seed(59)
|
|
from random import 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)
|
|
|
|
players.extend(generate_players(num_players=25, min_num_games=min_games, total_budget=100))
|
|
|
|
players = play_roulette(players, games=100)
|
|
|
|
for p in sorted(players, reverse=True):
|
|
print(p, "\n<br>")
|
|
|
|
</py-script>
|
|
|
|
</section>
|
|
|
|
</body>
|
|
|
|
</html>
|