7 Card Poker Hand Evaluator

前端 未结 9 755
死守一世寂寞
死守一世寂寞 2021-01-30 01:30

Does anyone know a fast algorithm for evaluating 7 card poker hands? Something which is more efficient than simply brute-force checking a every 21 5-card combination of hands fr

9条回答
  •  -上瘾入骨i
    2021-01-30 02:26

    I developed an algorithm for 7-card hand evaluation without iterating all 21 combinations.

    Basically, it splits the 7-card hand into two categories: flush and not a flush. If it's a flush, it would be easy to look up the value in a table of 8192 entries. If it's not a flush, it'll run a hash function with techniques of dynamic programming, and then look up the value in a hash table of 49205 entries.

    If you are interested, please check my work at github.

    https://github.com/HenryRLee/PokerHandEvaluator

提交回复
热议问题