Hand Rank Calculator/Simulator

I think most of us are aware that 3x16 gives you the best chance at hitting Full House or better in your shootout hand but there’s not a lot of information out there to show what influence your deck structure has on your shootout hands so I decided to write one.

Basically if you provide the script with a text file of your decks values and suits (an example is available in the codebase) and then run the calculator, it will work out the average hand rank (including cheating and just legal) and give you a breakdown of what hand ranks to expect.

Here’s a sample output

Average Cheating hand rank: 6.606900
Average Legal hand rank: 4.900600
Cheating Hand rank breakdown
No hand         : 0
High card       : 0
One Pair        : 0
Two Pair        : 1485
Three of a kind : 281
Straight        : 634
Flush           : 105
Full House      : 4392
Four of a kind  : 2538
Straight Flush  : 8
Five of a kind  : 557
Dead Mans Hand  : 0
Legal Hand rank breakdown
No hand         : 164
High card       : 47
One Pair        : 1016
Two Pair        : 2612
Three of a kind : 1088
Straight        : 1036
Flush           : 33
Full House      : 2833
Four of a kind  : 1090
Straight Flush  : 0
Five of a kind  : 81
Dead Mans Hand  : 0

Feel free to post questions/comments/feedback/bugs below. If you want to contribute to the project just send me a pull request on github.


Great tool!

It uses a top 5 draw, without redraw?
(Lowball hand or shootout with 0 stud, 0draw bonus)

Currently it only supports stud bullet ratings which you can either set using the --stud X parameter or use the default of 2 stud (so 7 cards). I’m just testing a lowball option that will show a breakdown of lowball hands (this isn’t simply 0 stud because Jokers are not used to complete sets in lowball) which I hope to push to github tonight. I’m also planning to add the new jokers from Light Shineth since that obviously has an effect.

Eventually I hope to add support for draw bullets but this is a lot more complicated and I suspect will take a lot longer to calculate so it might not be feasible to run it with that many iterations. It’s not a terrible approximation to consider draw bullets as stud bullets for low draw values.


An interesting statistic might be something like the average differential in rank between the highest cheating hand and the highest legal hand that can be made on each pull.

Example 1
Hand of: 9H, 9H, 9H, 9D, 7S, 7C, 5S
Highest Cheating: 4-of-a-kind (rank 8)
Highest Legal: Two Pair (rank 3)
Differential: 5 ranks

Example 2
Hand of: 9H, 9H, 9H, 9S, 9D, 7S, 7C
Highest Cheating: 5-of-a-kind (rank 10)
Highest Legal: Full House (rank 7)
Differential: 3 ranks

I’m not sure if just comparing the average cheatin’ hand rank and the average legal hand rank would really give you an accurate differential. If for no other reason that hands which are legal when creating the highest possible hand rank would have no differential, but they still factor into those stats when doing a diff comparison they wouldn’t.

Thanks for your suggestion.

Unfortunately mean differential isn’t that interesting a stat (and in fact is already available by simply taking the difference between the 2 means). The deviation is slightly more interesting but still doesn’t paint a very good picture. However, a breakdown of the difference between legal and cheating is probably an interesting graph. When I cheat, am I making small hand rank gains or is it taking me from Two Pair to Full House?

This shouldn’t be too difficult to add to the current stats so I’ll add that in. I’m considering using matplotlib (I’ve never used the library before) to plot some graphs and I imagine this is probably a reasonable dataset to plot in a graph rather than simply tabulate.

In other news, I’ve added a new option --lowball which shows lowball hands (so using Jokers negatively and overriding any stud options given).

I have an idea about determining lowball ranks from more than 5 cards (with 108 Worldly Desires, for instance). It goes like this:

  1. determine how many different values are present
  2. determine how many different suits are present (only if there are at least 3 different values)

1 value → 5-of-a-kind
2 values → 4-of-a-kind (if 1 value has only 1 card) or full house (if both values have at least 2 cards)
3 or 4 values in 1 suit → flush
3 values in at least 2 suits → 3-of-a-kind (if 2 values have only 1 card) or 2 pairs (if at least 2 values have 2 ), possibly a dead man’s hand if there are exactly 3 suits
4 values in at least 2 suits → pair
5 or more values in 1 suit → flush or straight flush
5 or more values in at least 2 suits → high card or straight

Straights, straight flushes and dead man’s hands are only possible with exactly 5 cards (any additional card would allow a lesser hand).