Legend:
- Unmodified
- Added
- Removed
-
hand.py
r9 r21 10 10 "four_of_a_kind", 11 11 "straight_flush" ] 12 13 #def format_hand(hand): 14 #input all 7 cards 15 def best_hand(cards): 16 all_poosible_hands = list(combNoReplace(cards,5)) 17 for h in all_poosible_hands: h.sort( cmp = lambda a,b: cmp(b,a) ) 18 pos_hands = [judge_hand(h) for h in all_poosible_hands] 19 return max(pos_hands) 20 12 21 13 22 #returns the best combination for the 5 cards … … 64 73 highest_n = current_n 65 74 highest_card = a 75 else: 76 last = a 77 current_n = 1 66 78 if highest_n == 1: return ("high_card",card_vals) 67 79 #check for full house
