Masuzu / GBFPokerBot

The return of the (in)famous Grandblue Fantasy poker bot
https://gbtools.azurewebsites.net/PokerBot/en/Home
10 stars 1 forks source link

Problems with certain hands #70

Closed granblue5eva closed 7 years ago

granblue5eva commented 7 years ago

Bot works well in general, but noticed a bug with an edge case - hand combinations that are a potential flush/straight and already contain a pair. For example, a hand with 2♠ 3x 4x 5x 2♥, where x can be any suit, the bot will choose to keep the entire hand, even though it is win-less. May need some sort of statement to force it to choose between win conditions, either keeping the pair and tossing the rest or only keeping 4 cards for a straight.

Masuzu commented 7 years ago

Hi,

This is an unintended bug indeed. Thank you for spotting this! I will fix this by Friday.

Masuzu commented 7 years ago

Actually, I am not sure I can reproduce the issue :thinking: Indeed, with the latest version, when you have such a hand (one away from a straight or one away from a flush with one pair), say 2♠ 3x 4x 5x 2♥ for instance, I added a unit test and made sure that only 4 out of the 5 cards were selected.

I will go through the whole hand space to check whether we fall into some cases where 5 cards would be kept, when I have some spare time. I will keep you posted.

Masuzu commented 7 years ago

I checked that there are no cases in which when the hand is one card away from a straight, all the cards are selected. Only 4 cards are selected. The described situation could have happened due to a card being mistaken for another one. For instance, in the given example, '2' could have been mistaken for a '6', resulting in the bot selecting all the cards. Should this case happen, the bot is able to detect that a mis-detection occurred and to go on "normally".