from playing_cards import Card, Deck, PokerHand

repeatnum = 20000

hand_types = ['high card', 'one pair', 'two pair', 'three of a kind', 'straight', 'flush', \
              'full house', 'four of a kind', 'straight flush']

counts = [0]*9

for i in range(repeatnum):
    
    d = Deck()
    d.shuffle()

    ph1 = PokerHand()
    ph2 = PokerHand()

    # do this 5 times
    for _ in range(5):
        # deal 1 card each to each player
        ph1.add_to_hand(d.deal())
        ph2.add_to_hand(d.deal())

    hand1_val = ph1.determine_hand() # will return a # 0 .. 8
    hand2_val = ph2.determine_hand() # will return a # 0 .. 8
    counts[hand1_val] += 1
    counts[hand2_val] += 1
    if i%1000 == 0:
        print(i)


for i in range(len(hand_types)):
    print(f'The number of {hand_types[i]:15s} hands was {counts[i]:6d} which is a probability of {counts[i]/(repeatnum*2):.6f} to 1.')
