From 6f3b00d2668d00ea0abdfc1e2ffb27d1bc14387b Mon Sep 17 00:00:00 2001 From: Michael Pilosov Date: Sun, 27 Nov 2022 01:41:02 -0700 Subject: [PATCH] print a graph --- index.html | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 6cceb08..48cf117 100644 --- a/index.html +++ b/index.html @@ -29,13 +29,18 @@
+
+
+
packages = [ "pyroulette", + "matplotlib" ] - + import pyroulette as pr +import matplotlib.pyplot as plt # seed(59) from random import randint @@ -53,11 +58,20 @@ for _ in range(1, 20): players = pr.play_roulette(players, games=100) -for p in sorted(players, reverse=True): - print(p, "\n
") +# get the wallet values for all players as a list +wallets = [player.wallet for player in players] +# plot the wallet values as a histogram +fig, ax = plt.subplots() +ax.hist(wallets, bins=50) +ax.set_yscale("log") +fig +
- + + for p in sorted(players, reverse=True): + print(p, "\n
") +