Two Plus Two Publishing LLC
Two Plus Two Publishing LLC
 

Go Back   Two Plus Two Poker Forums > >

Notices

Programming Discussions about computer programming

Reply
 
Thread Tools Display Modes
Old 11-21-2018, 03:39 AM   #1
tdw1221
stranger
 
Join Date: Nov 2018
Posts: 4
How to get a list of all poker hands rank

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
tdw1221 is offline   Reply With Quote
Old 11-21-2018, 02:33 PM   #2
RustyBrooks
Carpal \'Tunnel
 
RustyBrooks's Avatar
 
Join Date: Feb 2006
Location: Austin, TX
Posts: 24,223
Re: How to get a list of all poker hands rank

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.
RustyBrooks is offline   Reply With Quote
Old 11-26-2018, 01:48 AM   #3
tdw1221
stranger
 
Join Date: Nov 2018
Posts: 4
Re: How to get a list of all poker hands rank

Quote:
Originally Posted by RustyBrooks View Post
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
tdw1221 is offline   Reply With Quote
Old 11-26-2018, 01:52 AM   #4
RustyBrooks
Carpal \'Tunnel
 
RustyBrooks's Avatar
 
Join Date: Feb 2006
Location: Austin, TX
Posts: 24,223
Re: How to get a list of all poker hands rank

I didn't mention pokerstove at all, so... ?
RustyBrooks is offline   Reply With Quote
Old 12-17-2018, 09:13 AM   #5
kk<<trupqq
centurion
 
kk<<trupqq's Avatar
 
Join Date: Dec 2010
Posts: 115
Re: How to get a list of all poker hands rank

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.
kk<<trupqq is offline   Reply With Quote
Old 12-28-2018, 01:02 PM   #6
infinitydeltax
stranger
 
Join Date: Dec 2018
Posts: 6
Re: How to get a list of all poker hands rank

Quote:
Originally Posted by tdw1221 View Post
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.
infinitydeltax is offline   Reply With Quote
Old 12-30-2018, 09:51 PM   #7
Lawnmower Man
veteran
 
Lawnmower Man's Avatar
 
Join Date: Feb 2015
Posts: 3,153
Re: How to get a list of all poker hands rank

+1 to Cactus Kev

Some of his stuff seems to be here:

http://suffe.cool/poker/evaluator.html
Lawnmower Man is offline   Reply With Quote

Reply
      

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Forum Jump


All times are GMT -4. The time now is 03:15 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright 2008-2017, Two Plus Two Interactive
 
 
Poker Players - Streaming Live Online