-
Notifications
You must be signed in to change notification settings - Fork 202
Open
Description
I know this repo is not maintained, I still post this issue here in case anyone being confused about its behavior.
Issue
Here's what I encountered:
player [SixPlayer] gets hole card ['D5', 'HA'], current stack 100
player [G7Player] gets hole card ['CQ', 'D7'], current stack 100
Street "river" started. (community card = ['DQ', 'DJ', 'D9', 'CK', 'D6'])
"['SixPlayer']" won the round 1 (stack = {'SixPlayer': 720, 'G9Player': 0, 'G5Player': 0, 'HonestPlayer': 100, 'OurPlayer': 0, 'MyPokerPlayer': 0, 'RitzPlayer': 0, 'G3Player': 80, 'G7Player': 0})
Apparently, G7 shall win the game, because it has FLUSH with "D7", but SixPlayer has FLUSH with "D5". The result is wrong.
Root cause
See here:
| def __calc_hand_info_flg(self, hole, community): |
The flush can not be simply represented with only the max_rank_card. In fact, we need to compare these cards one by one.
In the issue we encountered, the flush was wrongly judged as the same for both G6 and G7, and then went to the 2nd bug (mentioned here), comparing the hole card, which results in G6 as the winner.
How to fix
We have to change how the "score" is represented for FLUSH. It shall contain 5 cards, instead of only 2.
# [Bit flg of hand][rank1(4bit)][rank2(4bit)]
# shall be:
# [Bit flg of hand][rank1(4bit)][rank2(4bit)][rank3(4bit)][rank4(4bit)][rank5(4bit)]
Metadata
Metadata
Assignees
Labels
No labels