siavashg87 / poker-odds-calc

Fastest and most accurate node module for calculating odds of poker games Texas Hold'em, Texas Shortdeck/Sixplus and Omaha.
MIT License
88 stars 32 forks source link

Wrong percentages on Omaha Hi with Three of a Kind #8

Open samuelsimoes opened 3 years ago

samuelsimoes commented 3 years ago

Hi, nice work on this odds calculation tool, although we found a possible flaw.

Give this Omaha Hi scenario:

The percentages returned by the lib are:

You can run it here: https://runkit.com/embed/n2um7788cwfh

but these percentages are wrong, look for example the results on CardPlayer odds calculator:

image

After doing some debugging, I found the solver is considering the Three of a Kind on the hand of player 2 on multiple occasions, more precisely 27 Three of a Kind instead of just 1 valid for this player, and it looks to be caused because the three cards on the player's hand being considered as a valid Three of a Kind.

I tried to find a solution, but I am struggling a bit with the code, if I find it, I will propose something, thank you!

McArrow commented 1 year ago

Here is a fix: https://github.com/siavashg87/poker-odds-calc/commit/af77e24112120d83bc5b57d327068f9fe53fffa7