FlagshipBugsauce / poker

0 stars 0 forks source link

Try Using a Lookup Table for Hand-Ranking #53

Open jon-gourley opened 4 years ago

jon-gourley commented 4 years ago

Should be able to construct a lookup table using the existing hand-ranking system whenever the app starts. This will give faster hand-ranking (even though hand-ranking speed isn't really a problem).

There are ~2.5m distinct hands. It should be fairly simple to iterate over all possible hands and mapping each hand to a rank. There are 21 5 card hands that can be made from 7 cards, so to find the best hand, we just need to try each of the 21 hands and keep the highest ranked hand.