printing improvements
This commit is contained in:
parent
b78eadc4dc
commit
3ef0072a80
3
app.py
3
app.py
@ -112,9 +112,8 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
print("======================")
|
print("======================")
|
||||||
print("SIMULATING GAMES")
|
print("SIMULATING GAMES")
|
||||||
# simulate 10 games
|
|
||||||
# seed(59)
|
# seed(59)
|
||||||
players = play_roulette(players, games=100000)
|
players = play_roulette(players, games=1000)
|
||||||
|
|
||||||
for p in sorted(players):
|
for p in sorted(players):
|
||||||
print(p, "\n")
|
print(p, "\n")
|
||||||
|
@ -280,10 +280,12 @@ class Player:
|
|||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
_nl = "\n\t" # custom newline character
|
_nl = "\n\t" # custom newline character
|
||||||
return (
|
return (
|
||||||
f"Player(id={self.id}, budget={self.budget}, wallet={self.wallet}, "
|
f"Player(id={self.id}, "
|
||||||
|
+ f"budget={round(self.budget, 2)}, "
|
||||||
|
+ f"wallet={round(self.wallet, 2)}, "
|
||||||
+ f"num_placements={len(self.strategy.placements)}, "
|
+ f"num_placements={len(self.strategy.placements)}, "
|
||||||
+ f"strategy_budget={self.strategy.budget}, "
|
+ f"strategy_budget={round(self.strategy.budget, 2)}, "
|
||||||
+ f"strategy_cost={self.strategy.value}"
|
+ f"strategy_cost={round(self.strategy.value, 2)}"
|
||||||
+ f"\nstrategy:{_nl}{_nl.join(map(str, sorted(self.strategy.placements)))}"
|
+ f"\nstrategy:{_nl}{_nl.join(map(str, sorted(self.strategy.placements)))}"
|
||||||
+ "\n)"
|
+ "\n)"
|
||||||
)
|
)
|
||||||
|
2
setup.py
2
setup.py
@ -10,7 +10,7 @@ with open(BASEDIR.joinpath("README.md"), "r") as fp:
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="pyroulette",
|
name="pyroulette",
|
||||||
version="0.0.3",
|
version="0.0.4",
|
||||||
description="A package for exploring roulette strategies.",
|
description="A package for exploring roulette strategies.",
|
||||||
long_description=LONG_DESCRIPTION,
|
long_description=LONG_DESCRIPTION,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
|
Loading…
Reference in New Issue
Block a user