You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like we might have an issue with calculating the winning hands.
I only came across this last night at about 1am... so I haven't had a chance to debug it properly, so I'll provide some more information or a PR to fix it tonight but figure depending on your timezone you might get there first. This is using the new poker-hand-details branch, so I'm not sure if it's on the main branch yet.
Try running this game through:
Community cards: 7S 3S 4C 5H 6D
Player 1's name and two cards: Bob 2C 8D
Player 2's name and two cards: Joe 8S 9C
Result:
1 Joe High Card Nine
2 Bob High Card Eight
...what? Shouldn't that be a straight for both players?
It has the proper value, but the handType is not being set as we'd expect. Strange, and a critical bug, but shouldn't be too hard to dig into. Weird that tests are passing, but in-practice, I can't seem to get the proper result out.
Sorry to keep bundling these into the feature/poker-hand-details branch, but this bug was definitely there, and it was due to improper combination building.
I've adjusted this to use same Combination producing function as elsewhere in the code and it works as I expected. I added a new unit test to capture this.
I will close this issue once this branch gets merged in.
I'm submitting a ...
Summary
Hey @mitch-b,
It looks like we might have an issue with calculating the winning hands.
I only came across this last night at about 1am... so I haven't had a chance to debug it properly, so I'll provide some more information or a PR to fix it tonight but figure depending on your timezone you might get there first. This is using the new poker-hand-details branch, so I'm not sure if it's on the main branch yet.
Try running this game through:
Community cards: 7S 3S 4C 5H 6D
Player 1's name and two cards: Bob 2C 8D
Player 2's name and two cards: Joe 8S 9C
Result:
1 Joe High Card Nine
2 Bob High Card Eight
...what? Shouldn't that be a straight for both players?
`${result.toString()} ${result.scoringHandCardNames.map(cn => CardName[cn]).join(' ')}`
The text was updated successfully, but these errors were encountered: