Re: creating a hierarchy
Given the number of hands, ranking them looks tricky. Perhaps as suggested, test for the 9 differing hand types then assign a value on the hand. this value will differ for each hand type.
perhaps:
def testFlush(hand):
if hand[0][1] == hand[1][1] and hand[0][1] == hand[2][1] and hand[0][1] == hand[3][1] and hand[0][1] == hand[4][1]
return True
Using a dict, perhaps inefficient, but you could assign the value poe(10, 12) to an ace down to pow(10,0) for a 2. Thus a flush with an ace would always outrank a hand with a king etc.
I would be interested to see an efficient test for a full house.
_______________________________________________ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector