Poker Bot Command Line Tool – AllHandsDesc

This is post #14 in an ongoing series of articles about my work as a poker bot developer.

Over the next several posts, I’m going to publish several command line tools that I developed in the course of building my poker bot.

None of these tools will enable anyone who can’t already build a poker bot to build one so I don’t think there’s much harm in posting them.

All of these were build on top of Poker Eval, an open source C library for doing poker calculations.

Tool #1: AllHandsDescC

Click here to download the ZIP file (6 KB)

Purpose: This tool will iterate over every possible hole card combination a player can have and spit out its rank when combined specified board cards.

Example:

>> allhandsdesc Td Ts 8h

As Ks - NoPair (A K 2 2 2) - OnePair (T 8 2 2) - OnePair (T A K 8) @ 280
As Qs - NoPair (A Q 2 2 2) - OnePair (T 8 2 2) - OnePair (T A Q 8) @ 292
As Js - NoPair (A J 2 2 2) - OnePair (T 8 2 2) - OnePair (T A J 8) @ 304
As Ts - NoPair (A T 2 2 2) - OnePair (T 8 2 2) - TwoPair (T 2 A) @ 282
As 9s - NoPair (A 9 2 2 2) - OnePair (T 8 2 2) - OnePair (T A 9 8) @ 316
As 8s - NoPair (A 8 2 2 2) - OnePair (T 8 2 2) - TwoPair (T 8 A) @ 119
As 7s - NoPair (A 7 2 2 2) - OnePair (T 8 2 2) - OnePair (T A 8 7) @ 328
As 6s - NoPair (A 6 2 2 2) - OnePair (T 8 2 2) - OnePair (T A 8 6) @ 340
As 5s - NoPair (A 5 2 2 2) - OnePair (T 8 2 2) - OnePair (T A 8 5) @ 352
As 4s - NoPair (A 4 2 2 2) - OnePair (T 8 2 2) - OnePair (T A 8 4) @ 364
...

Output Format:

There are five pieces of information per output line. Using the first line above as our example:

As Ks - NoPair (A K 2 2 2) - OnePair (T 8 2 2) - OnePair (T A K 8) @ 280

As Ks – Hole cards we’re checking

NoPair (A K 2 2 2) – This is the rank of the hole cards by themselves. It will either be NoPair or OnePair, in the case of a pocket pair. A K 2 2 2 is a way of representing the strength of the NoPair: Ace high, followed by king, and since we only gave it two hole cards, it defaults to twos for the rest of the five-card hand: 2 2 2.

OnePair (T 8 2 2) – This is the rank of the board cads by themselves. Td Ts 8h makes one pair: Two tens, followed by an eight, followed by two default 2’s. Note that the out shows “T 8 2 2 2” not “T T 8 2 2” because two tens are implied by its rank of “OnePair”.

OnePair (T A K 8) – This is the rank of the hole cards plus the board cards. As Ks Td Ts 8h makes one pair: two tens, followed by an ace, a king, and an eight.

@ 280 – This shows the number of hole card combinations that can beat these hole cards on this board. Consider a few example from this hand:

Tc 8d - NoPair (T 8 2 2 2) - OnePair (T 8 2 2) - FlHouse (T 8) @ 0

Since you hold a ten, it’s not possible for someone else to have quads, so you have the nuts–no hands can beat you.

Tc Th - OnePair (T 2 2 2) - OnePair (T 8 2 2) - Quads (T 8) @ 0

If you hold the two tens, you have quads, and there are no hands that can beat you.

Ks Tc - NoPair (K T 2 2 2) - OnePair (T 8 2 2) - Trips (T K 8) @ 10

If you hold Ks Tc, there are ten hands that can beat you: Six from full houses: Th 8c, Th 8d, Th 8s, 8d 8h, 8d 8s and four from higher trips: Th Ac, Th Ad, Th As, Th Ah.

If you have any questions, don’t hesitate to leave a comment below.

Leave a comment