atharvapatil22 / PokerAI

0 stars 0 forks source link

Fix Check implementation #19

Closed TiptonG closed 2 months ago

TiptonG commented 2 months ago

I implemented "Check" as "Call when incoming bet is 0", which is not right. Checking in poker is "passing your turn" and can only be done when no one has bet before you.

One website seems to think that the Big Blind can check in the preflop IF everyone calls befoer them... since the incoming bet is 0 and "no one has bet before you"???

I'm not sure what to implement, so @brettyukino9 has asked his brother about the official ruling... since I can't find anything concrete online.

If the former is true, it'll just require a "checkFlag" boolean that is initially true in all phases except the first (this boolean will eventually be a field of the Board object class), and players can only check whenever the flag is true. If a player performs any action BESIDES check, and the checkFlag boolean is true, it is set to false and all players have their playerPassing variable set to False(to give those who checked a chance to act in the current round).

It is also worth noting that you CANNOT "call" if there is no incoming bet... which raises other concerns... this ticket has not been fully defined yet... so stay tuned as to how it gets resolved

TiptonG commented 2 months ago

You cannot call if there is no incoming bet, and the big blind CAN check in the pre-flop if everyone else called. So...you can only check if the flag is true AND the incoming bet is 0, and calling does not set the check flag to false. Got it.

TiptonG commented 2 months ago

Fixed by #20