Ok, so I am making a Texas Hold'em AI for my senior project. I've created the gui and betting/dealing procedures, but I have reached the part where I need to determine who won the hand, and I do not know the best way to approach this. I am using python btw. ATM i have 2 lists, one for the 7 player cards, one for the 7 computer cards. Currently all cards are stored as a struct in the list as {'Number': XX, 'Suit': x}, where number is 2-14, suit is 1-4. The way I was going to approach this, is make a function for each hand type, starting with the highest. Eg. self.CheckRoyal(playerCards), and manually go through the list and evaluate if a royal flush was achieved. There has to be a better, numerically way to do this.
If two or more players have the same hand the high card determines the winner. For straights or flushes, the highest top card is declared the winner. For one pair and two pair hands, the highest kicker wins. If players have the same 5-card hand, it is a tie and the pot is split equally.
Effective Hand Strength (EHS) is a poker algorithm conceived by computer scientists Darse Billings, Denis Papp, Jonathan Schaeffer and Duane Szafron that was published for the first time in the research paper (1998).
http://www.codingthewheel.com/archives/poker-hand-evaluator-roundup
Best algorithm you will get is 7 looks in lookup table of size 100 MB (if I remember correctly)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With