Example #1
0
def main():
    n = 100000
    freqs = {}

    for i in range(n):
        deck = Deck()
        deck.shuffle()
        hand = PokerHand()
        deck.draw(hand, 5)
        hand.classify()
        freqs[hand.label] = freqs.get(hand.label, 0) + 1

    print("Estimated probabilities:")
    for key in PokerHand.all_labels:
        print(f"{key} \t\t {(freqs.get(key, 0) / n):.10f}")