Coder Social home page Coder Social logo

pokersolver's People

Contributors

fvilers avatar goldfire avatar okaybenji avatar smyrick avatar wschmrdr avatar

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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

pokersolver's Issues

Solving as a "Full House" instead of "Four of a Kind".

The following will give me "Four of a Kind, A's" as expected:
Hand.solve(['Ad', 'As', 'Jc', 'Th', '2d', '0r', '0r']).descr;

However, the following is giving me "Full House, 10's over A's" instead of the expected "Four of a Kind, A's":
Hand.solve(['Ad', 'As', 'Ac', 'Th', '2d', '0r', '0r']).descr

Omaha Hold'em

I'd like to add the Omaha Hold'em rules to this library (I've been using the standard and works hells good).

Looking at how rules are set up, I was thinking on running all combinations of 2 from the hand cards and 3 from the table, but that might not be that performant.

Do you think there's a better approach for this @goldfire ?

Thanks in advance

can you predict the output for the below example ? as per the documentation it should give two winners. However, giving me only one winner and that too precedence of the player in the array passed.

var hand1 = Hand.solve(['Ad', '2s', '9h', '4d', '5h']);
hand1.name = 'preetham';
console.log('hand1 ==>'+hand1.name); // Two Pair 
console.log('hand1 ==> '+hand1.descr);

var hand2 = Hand.solve(['Ad', 'As', 'Jc', '3h', '2d']);
hand2.name='rocker';
console.log('hand2 ==> '+hand2.name); // Two Pair 
console.log('hand2 ==>'+hand2.descr);

var hand3 = Hand.solve(['Ah', 'Ac', 'Jd', '3c', '2f']);
hand3.name='Baxish';
console.log('hand2 ==> '+hand3.name); // Two Pair 
console.log('hand2 ==>'+hand3.descr);


var winner = Hand.winners([hand1, hand3,hand2]);
console.log(winner[0].name)

Wrong Hand Strength Name

Hi Team

I got an issue with Royal Flush Hand Strength with these cards.

var communityCardss = ["3s","Jh","Qh","Th","8c"];
Var Playercards = [
"Kh",
"Kd",
"5h",
"5d",
"Ah"
];

OutPut:
name: 'Straight Flush',
descr: 'Royal Flush',
cardCombination: [ 'Ah', 'Kh', 'Qh', 'Jh', 'Th' ],
rankname: 'Straight Flush',
rankdesc: 'Royal Flush' } ]

But it should be
Name: 'Royal Flush'

Can't run example code as shown on npm page.

I'm running on Ubuntu.

I'm installing pokersolver like so, while in the directory of my project:

npm install pokersolver

I'm trying to run a file where this is the only line:

var Hand = require('pokersolve').Hand;

This causes a "Can't find module 'pokersolve'" error. I figure it's a type so I've changed it to:

var Hand = require('pokersolver').Hand;

Which causes the following error

/media/E/Storage/Code/project/node_modules/pokersolver/pokersolver.js:16
  class Card {
  ^^^^^

SyntaxError: Unexpected reserved word
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/media/E/Storage/Code/flopzilla/new_zilla.js:1:74)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

Are sub rankings given?

Sorry if I missed this but just wonder if there’s a global sub ranking for each possible hand?

10's coming out as 10's without suit

I hope I am not doing anything wrong here but looks like all 10's comes out without suit when I use poker solver solve method and return cards from that object. Everything else works, see example picture:

image

this should have come out as 10h, 10s

isPossible === true with duplicate cards

Hi, I'm poking around with the library and making a few tests before using it. If I solve a handle with two duplicate cards (Queen of diamond for example) the returning structure still has a isPossible flag to true. Shouldn't it be false?

Using kickers in combinations

First of all, thank you for making this useful module.
I'm working with this product and found some interesting point:

  • Desk has 9c Kh Kd 9s Ah
  • First user has Qc 5h
  • Second user has 5d Jd

Library returns two winners, but as we can assume, due to kicker, winner is 1st player. Is it possible to distinguish somehow community cards or hand cards to make correct output for Hand.winners method?
Thanks in advance!

flush boars

take look at this
Screenshot (19)

if the board is flush with heart and some players have heart then all players are winners !!! WRONGG

for more information : flush board rules

Winner

How do you output which hand is a winner? If I get two hands that are both A-high, the description doesn't include the kicker. How do I know which won?

Straight not evaluated correctly.

For the statement, console.log("output", Hand.solve([ 'Ts', 'Qh', '7c', '8s', '9s'])), it is returning me
High Card, and expected result is Straight.

Royal Flushes Not Evaluated Correctly for Deuces Wild

console.log(Hand.solve(['2s','Kc','Jc','2d','Qc'],'deuceswild').name) evaluates to only a straight flush. Same goes for a natural royal.

If you change .name to .descr it works, but adds extra info for all the other hands. I am trying to figure out a fix, but these evaluation libraries are always convoluted to the person that didn't write them.

Joker Wild Ranking Issue

Joker Wild does not payout a pair of Kings yet is says in the documentation that it does.

Two Pair is currently ranked 2,

h.qualifiesHigh is not a function

Hand.solve() seems to be working fine, but when trying to compare hands with Hand.winners(), I get the following error: 'h.qualifiesHigh is not a function'

console.log(hand1, hand2)
// ['9h', '4s', '5s', 'Ts', '7d', 'Jh', 'Jc'] (7) ['9h', '4s', '5s', 'Ts', '7d', 'As', 'Ks']

console.log(Hand.solve(hand1), Hand.solve(hand2))
// OnePair {cardPool: Array(7), cards: Array(5), suits: {…}, values: Array(11), wilds: Array(0), …}
// Flush {cardPool: Array(7), cards: Array(5), suits: {…}, values: Array(14), wilds: Array(0), …}

console.log(Hand.winners([hand1, hand2]))
// TypeError: h.qualifiesHigh is not a function

error seems to stem from the following lines of code

  hands = hands.filter(function(h) {
    return h.qualifiesHigh();
  });

How to use for evaluating low hands?

Hey.

I want to evaluate low hands(worst hand) (7 cards), standard deck, game type = standard. Is that possible using this library ? How to achieve that ?

Thanks.

return the position of winner/s when Hand.winners(hands_list) ?

When applying the module for my poker server I found interesting that the method winners doesn't return the position of the winner in the array of hands passed. I think it would be really useful. Do I start working on that or is there some solution to this problem that I'm not seeing?

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.