siavashg87 / poker-odds-calc Goto Github PK
View Code? Open in Web Editor NEWFastest and most accurate node module for calculating odds of poker games Texas Hold'em, Texas Shortdeck/Sixplus and Omaha.
License: MIT License
Fastest and most accurate node module for calculating odds of poker games Texas Hold'em, Texas Shortdeck/Sixplus and Omaha.
License: MIT License
I want to express my appreciation for the excellent work on the odds calculation tool. It has proven to be a valuable asset in our poker-related endeavors.
During our usage, we encountered a potential flaw in the tool, specifically in the handling of 5-card Omaha scenarios. After a thorough investigation, we believe we have identified a particular code segment that may be causing an unintended error.
In the Player.js file, located at the path /poker-odds-calc/dist/lib/Player.js, we observed the following lines of code:
setHand(hand) {
const game = this.Table.getGame();
if ((game.isTexasHoldem() || game.isSixPlusTexasHoldem()) && hand.length !== 2)
throw new Error("A Texas hold'em hand must contain exactly 2 cards!");
if (game.isOmaha() && hand.length !== 4)
throw new Error("An Omaha hand must contain exactly 4 cards!");
this.hand = hand.map(c => {
const card = this.Table.getDeck().getCards().find(card => card.toString() === c);
if (!card)
throw new Error(`Card "${c}" not found!`);
return card.setOwner(this);
});
return this;
}
We believe that the condition checking for the length of the hand in Omaha games might be causing unnecessary issues. To address this, we suggest commenting out the relevant lines, as shown below:
setHand(hand) {
const game = this.Table.getGame();
if ((game.isTexasHoldem() || game.isSixPlusTexasHoldem()) && hand.length !== 2)
throw new Error("A Texas hold'em hand must contain exactly 2 cards!");
// Commenting out the condition for Omaha hand length
// if (game.isOmaha() && hand.length !== 4)
// throw new Error("An Omaha hand must contain exactly 4 cards!");
this.hand = hand.map(c => {
const card = this.Table.getDeck().getCards().find(card => card.toString() === c);
if (!card)
throw new Error(`Card "${c}" not found!`);
return card.setOwner(this);
});
return this;
}
This modification allows for a smoother handling of 5-card Omaha scenarios. We hope you find this information helpful in maintaining and improving the overall functionality of the odds calculation tool.
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:
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!
I would like to calculate the odds for combinations without knowing opponent hands. This should probably only require to remove the check?
We cannot add dynamically the number of seats for the table as the constructor does not use the argument . can we add in this fix
How should I add support for Omaha 5 cards odds calculation?
I'm aware that First step would be to increase the input of min no. of hole cards
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.