Open Side Menu Go to the Top
Register
How to get a list of all poker hands rank How to get a list of all poker hands rank

11-21-2018 , 03:39 AM
This might be a quite stupid question, I'm trying to make a home brewed tool for myself on Julia for poker analysis.

For comparison of two hands (each with 5 cards), one way I could think of is to obtain their rankings in all possible hands list (~2.6 million), originally I thought tools like ps-lut (from poker stove cpp) could probably give me that list however it doesn't, the thing I want would be something like:

hands rank
TcJcQcKcAc 1
TsJsQsKsAs 1
.....
2s3c5c6d7c 99924
.....

Does anyone know is there a way I could get one (I'm aware that this would be a huge list)? Thanks
How to get a list of all poker hands rank Quote
11-21-2018 , 02:33 PM
There are probably some hard-coded lists out there already but it wouldn't be too hard to generate your own. There are tons of scoring algorithms out there, either copy or implement one of them and set it loose on all the 5-card hands and store your results.

There's a "2 plus 2 evaluator" that you could look at
https://github.com/tangentforks/TwoPlusTwoHandEvaluator
There's a giant thread out there somewhere where a lot of the techniques got hashed out.
How to get a list of all poker hands rank Quote
11-26-2018 , 01:48 AM
Quote:
Originally Posted by RustyBrooks
There are probably some hard-coded lists out there already but it wouldn't be too hard to generate your own. There are tons of scoring algorithms out there, either copy or implement one of them and set it loose on all the 5-card hands and store your results.

There's a "2 plus 2 evaluator" that you could look at
https://github.com/tangentforks/TwoPlusTwoHandEvaluator
There's a giant thread out there somewhere where a lot of the techniques got hashed out.
Thanks, the problem I found with pokerstove command line is that it doesn't actually generate all combinations when I catch all 5-card situations, I'm not sure if it's an issue with file size limit or it was optimized to this
How to get a list of all poker hands rank Quote
11-26-2018 , 01:52 AM
I didn't mention pokerstove at all, so... ?
How to get a list of all poker hands rank Quote
12-17-2018 , 09:13 AM
Cactus Kev made a post about this years and years ago. Basically, every non-flush hand has at least one card that differs in rank. So if you assign each rank a prime number and multiply all 5 cards together, you'll get a unique ID for every possible non-flush hand. Then you just have to order/map them, so you know which ID is better/worse in terms of being a winning poker hand.

For any game where you have up to 7 cards and are trying to determine which combination of 5 cards from those makes the best five card poker hand, if a flush or straight flush is possible, then it will be the best hand, so you just compare the possible flushes against each other. (So you have two groups of ordered IDs: one for flushes and one for non-flushes.) (That's an optimization, you don't strictly need to do it.)

So to determine a winning hand, you just compare the best of the 7 choose 5 = 21 possible hands from one player with the best of the 21 possible hands of the other player.
How to get a list of all poker hands rank Quote
12-28-2018 , 01:02 PM
Quote:
Originally Posted by tdw1221
This might be a quite stupid question, I'm trying to make a home brewed tool for myself on Julia for poker analysis.

For comparison of two hands (each with 5 cards), one way I could think of is to obtain their rankings in all possible hands list (~2.6 million), originally I thought tools like ps-lut (from poker stove cpp) could probably give me that list however it doesn't, the thing I want would be something like:

hands rank
TcJcQcKcAc 1
TsJsQsKsAs 1
.....
2s3c5c6d7c 99924
.....

Does anyone know is there a way I could get one (I'm aware that this would be a huge list)? Thanks
This isn't exactly what you're looking for, but if you're interested in a fun programming project, implementing a hand ranker is a nice blend of interesting and challenging. Shouldn't take too long, either.
How to get a list of all poker hands rank Quote
12-30-2018 , 09:51 PM
+1 to Cactus Kev

Some of his stuff seems to be here:

http://suffe.cool/poker/evaluator.html
How to get a list of all poker hands rank Quote
04-30-2019 , 01:27 AM
Thanks for your guys' response, I have been working on it and it turns out to be a quite interesting project
How to get a list of all poker hands rank Quote
04-30-2019 , 01:29 AM
And thank you both, Cactus Kev's code is extremely helpful

Quote:
Originally Posted by Lawnmower Man
+1 to Cactus Kev

Some of his stuff seems to be here:

http://suffe.cool/poker/evaluator.html
How to get a list of all poker hands rank Quote

      
m