Calcul en temps réel de la chance statistique de chaque joueur d'une partie de poker de gagner une main donnée.
Pas encore de cli, vous pouvez exécuter des cas de test en éditant main.py
:
# ...
# The seed state of the table and players.
# - player_cards requires one entry in the player_cards list for each player, with exactly two cards each
# - table_cards requires a list of known cards on the table. This reflects the current state of
# the table, so it can be a list with 0 cards, or 3/4/5 cards.
s = {
"player_cards" : [
[ Card ( 8 , Suits . Diamonds ), Card ( 10 , Suits . Hearts )],
[ Card ( 12 , Suits . Spades ), Card ( 10 , Suits . Spades )]
],
"table_cards" : [
Card ( 13 , Suits . Spades ),
Card ( 14 , Suits . Spades ),
Card ( 12 , Suits . Diamonds ),
Card ( 12 , Suits . Clubs )
]
}
def main ():
# initialize table state
t = Table ( player_count = len ( s [ 'player_cards' ]))
d = Dealer ()
d . deal ( table = t , seed = s )
# the dealer can update state to reveal new random cards if necessary
d . flip ( t )
print ( " n Table: n " )
print ( t . table_cards_str ())
# initialize the stats engine
p = Pokerstatter ()
start = time . time ()
print ( ' n Begin evaluate:' )
# evaluate the current table state
# any valid table state can be evaluated(0 cards or 3/4/5 cards)
# less known cards takes more time
p . evaluate ( t )
end = time . time ()
print ( f"Completed in { end - start } s" )
print ( t . players_str ())
# ...