Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect calculation of highest combination when there's only kicker. #9

Closed
bowenbowensun opened this issue Jun 24, 2021 · 2 comments

Comments

@bowenbowensun
Copy link
Contributor

bowenbowensun commented Jun 24, 2021

The following hand should return the board as the combination. However, the pocket cards are included in the highestCombination. Is this a bug or am I using it incorrectly?

const pack = new Pack()
const holeCards = new Hand([
pack.createCard('clubs', 2),
pack.createCard('clubs', 3)
])
const board = new Hand([
pack.createCard('spades', 4),
pack.createCard('hearts', 5),
pack.createCard('clubs', 10),
pack.createCard('diamonds', 'jack'),
pack.createCard('spades', 'queen')
])
const col = HandsCollection.createCombinations(board, holeCards).highestCombination
console.log(col._hand.cards)

prints out
[ Card { suit: 20, rank: 0 }, Card { suit: 20, rank: 1 }, Card { suit: 20, rank: 8 }, Card { suit: 21, rank: 9 }, Card { suit: 23, rank: 10 } ]

which is incorrect as the pocket cards 2 and 3 is smaller than the community cards 4 and 5.

@Merisho
Copy link
Owner

Merisho commented Jul 11, 2021

@bowenbowensun Thank you for the issue.

This looks wrong, indeed. I will take a look at it in the course of the next week.

@Merisho
Copy link
Owner

Merisho commented Sep 22, 2021

The PR with the fix has been merged into master, closing the issue

@Merisho Merisho closed this as completed Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants