0

I am working on online poker software and there is 1 issue we faced when testing with tournaments.
Let me explain the case
There were 6 players in the hand
p1 (SB) 2820 chips
p2 (BB) 100 chips
p3 15990 chips
p4 10445 chips
p5 215 chips
p6 (D) 25325 chips
Blinds were 500/1000, Ante 100
So firstly I took the Ante from players and since all players have sufficient money to post the ante there was no side pot created when I evaluated the stacks.
Pots Info after ante posted 600(p1, p2, p3, p4, p5, p6)
After this Blinds were posted and since p1(SB) has sufficient amount for small blind he post the small blind but p2 was all-in blinds were not posted by him.
In preflop round following actions were taken by players:
p1 posts SB stacks[p1] = 500
p2 All-in stacks[p2] = 0
p3 Fold stacks[p3] = 0
p4 Fold stacks[p4] = 0
p5 Fold stacks[p5] = 0
p6 Raise(25225) and goes All-in stacks[p6] = 25225
p1 Folds
p2 was already all-in turn didn't went to him

Now what went wrong was after this when I evaluated the stacks again since there was no side-pot created earlier what happened was that p6 raised amount went to main-pot along with 500 from p1 and now the pots information was like
26325(p2, p6)
And in this case, p2 has a better hand than p6 so he took 26325 pot with him
Now I know this is not how it was supposed to run I think the right way(correct me If I am wrong) for this hand to be evaluated was like this
600(p2, p6) 25725(p6)
So p6 gets the side pot 25725 and p2 gets 600 pot
But since p2 has exactly the same amount as was required by ante no side pot was created when ante was evaluated, and since no other player called side pot was not created later also
My question is how should I check for this case should I treat as a special case?
Can this happen with any position if he has only that much amount to post ante only? (I think it will)
Please note that In cases when players have less hand money than ante side pot do get created in this scenario It was exactly the same amount as ante
1 way I was thinking to fix this bug was to check if (there is 1 pot) AND (1 or more players are all-in) after posting the ante and then creating a side pot having only those players who are not all-in but I am not sure maybe I will miss some other case? Please provide feedback Thanks

0

Treat the antes like a bet. And/or always set up a side pot whenever a player hits zero chips even if the side pot is zero. Looks like what is going on is that there was no side pot at this point and your program did not know at this point to have a side pot and did not know there was supposed to be a side pot. You just need to branch off to create a side pot when the condition calls for a side pot. Slap the dealer on the hand before he pulls in the chips to the main pot.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.