Giter VIP home page Giter VIP logo

poker-odds-calc's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

poker-odds-calc's Issues

Identified Issue and Suggested Fix in Odds Calculation Tool (5 Card Omaha Variant)

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.

Wrong percentages on Omaha Hi with Three of a Kind

Hi, nice work on this odds calculation tool, although we found a possible flaw.

Give this Omaha Hi scenario:

  • Board: 2d, 5c, Qh, Js
  • Player 1: 5d, Qs, Qc, 7d
  • Player 2: Kd, Kh, Ad, Ks

The percentages returned by the lib are:

  • Player 1 - QsQc7d5d - Wins: 22.50% - Ties: 0.00%
  • Player 2 - AdKdKhKs - Wins: 77.50% - Ties: 0.00%

You can run it here: https://runkit.com/embed/n2um7788cwfh

but these percentages are wrong, look for example the results on CardPlayer odds calculator:

image

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!

Omaha 5

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.