-
Notifications
You must be signed in to change notification settings - Fork 2
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
Performance refactor 2 #7
base: main
Are you sure you want to change the base?
Conversation
The `hand` property value of `EvaluatedHand` objects returned by the `evaluate` function now order matching cards by suit alphabetically (c, d, h, s) rather than the order they appeared in the provided hole card & community card arrays. BREAKING CHANGE
Reverts BREAKING CHANGE from previous commit
…emove value from type
eefdf8a
to
1437520
Compare
// TODO: enable this once implementation works | ||
it.skip('heads-up, all hole cards provided', () => { | ||
const hands: Hand[] = [ | ||
['As', 'Ks', 'Kh', 'Tc'], | ||
['Ad', 'Kd', 'Qd', 'Js'], | ||
]; | ||
|
||
expect(odds(hands, { ...omahaOptions, communityCards: ['Qd', 'Js', '8h'] })).toEqual([ | ||
{ wins: 45, ties: 900, total: 990, equity: 0.5 }, | ||
{ wins: 45, ties: 900, total: 990, equity: 0.5 }, | ||
]); | ||
}); | ||
|
||
// TODO: enable this once implementation works | ||
it.skip('heads-up, all hole cards provided without community cards', () => { | ||
const hands: Hand[] = [ | ||
['As', 'Ks', 'Kh', 'Tc'], | ||
['Ad', 'Kd', 'Qc', 'Jc'], | ||
]; | ||
|
||
expect(odds(hands, { ...omahaOptions, communityCards: [] })).toEqual([ | ||
{ wins: 45, ties: 900, total: 990, equity: 0.5 }, | ||
{ wins: 45, ties: 900, total: 990, equity: 0.5 }, | ||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to address this TODO
// TODO: this implementation is not making use of `minimumHoleCardsUsed` or `maximumHoleCardsUsed` | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
minimumHoleCardsUsed, | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
maximumHoleCardsUsed, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to address this TODO
// TODO: This approach won't work for games with many cards per hand, such as 5-card omaha, | ||
// since such a hand could have multiple flushes. | ||
const matchingMask = [ss, sc, sd, sh].find((mask) => CARD_RANK_TABLE[bigintKey(mask)] >= 5); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to address this TODO
TODO: update benchmarks before merging |
No description provided.