def all_cards(init): """ Generate ALL the possible combinations and find the REAL probabilities given """ d = Deck(DECK_CARDS) d.remove(init) ranks = defaultdict(lambda: 0) count = 0 for hand in combinations(d.cards, 4): count += 1 h = RazzHand(list(hand) + init[:3]) got_rank = h.rank() ranks[got_rank] += 1 return ranks, count
def test_PairLosesAgainstHighCard(self): p1 = RazzHand([13, 13, 7, 6, 2]) p2 = RazzHand([10, 7, 3, 2, 1]) self.assertTrue(p1.rank() < p2.rank())
def test_RazzHandRanksCorrectly(self): hand = RazzHand([6, 4, 3, 2, 1]) self.assertEqual(hand.rank(), 6)