goldfire / pokersolver

Javascript poker hand solver.
MIT License
373 stars 93 forks source link

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

Open acidicchip opened 6 years ago

acidicchip commented 6 years ago

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

goldfire commented 6 years ago

I assume you were using this for paigowpokerhi? If so, you need to pass in the game string like:

Hand.solve(['Ad', 'As', 'Ac', 'Th', '2d', '0r', '0r'], 'paigowpokerhi').descr
acidicchip commented 6 years ago

I was actually trying to use it to determine the highest possible (future) hand in Texas Hold'em by specifying 2 wildcards to represent what hasn't been laid out yet.

So ['Ad', 'As', 'Ac', 'Th', '2d', '0r', '0r'] would be 2 As in my hand, A,T,2 on the flop, and 2 variables (yet to come for the middle and river).

I figured it wasn't intended for that, but still thought it might had been a bug since one of them shows a full house as a winner, the other 4 of a kind, both contain 4+ of a kind.

goldfire commented 6 years ago

Okay, that seems to be a bug as there was no intended support for wildcards in the Texas Hold'em solver, but I can see how that use-case would be useful.

acidicchip commented 6 years ago

It would be nice if it also listed all possible hands in order of rank (cards, probability, etc.).

I'm basically making a HUD for texas hold'em to assist new players. I've kind of already started writing my own hand appraiser more specifically for my use case, but it'd be nice not to have to reinvent the wheel if it can be easily implemented into the great work you've already done.

ericblade commented 6 years ago

There's certainly a functional difference between a wild card, and an unknown card. There's no reason why someone couldn't play holdem with wilds (we've certainly done it in home games before :-) ) but a wild is a big difference to an unknown. If there's already wild card support in the solver, I'd suggest allowing it, but that would also allow hands that wouldn't normally be possible (5 of a kind).

... commenting as a programmer and a poker player, not as someone who's intimitely familiar with pokersolver, i have it watched just because i like it, not because i use it currently :-)

acidicchip commented 6 years ago

Yeah, there's definitely a difference between a wild and an unknown, but I was banking on the fact that a 5 of a Kind doesn't exist in standard poker rules and expecting pokersolver to know that, since I used the default hand settings.

ericblade commented 6 years ago

I guess what I'm saying, is that I'd recommend having both functioning wild-cards in all variants, and having a separate indicator for "Unknown", like maybe "??" or something.