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

Performance refactor 2 #7

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft

Performance refactor 2 #7

wants to merge 17 commits into from

Conversation

mhuggins
Copy link
Member

No description provided.

src/__tests__/odds.test.ts Outdated Show resolved Hide resolved
@mhuggins mhuggins force-pushed the performance-refactor-2 branch from eefdf8a to 1437520 Compare May 13, 2024 03:15
Comment on lines +120 to 143
// 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 },
]);
Copy link
Member Author

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

Comment on lines +24 to +28
// 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,
Copy link
Member Author

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

Comment on lines +43 to +45
// 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);
Copy link
Member Author

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

@mhuggins
Copy link
Member Author

TODO: update benchmarks before merging

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

Successfully merging this pull request may close these issues.

1 participant