Skip to content
solenskiner edited this page Nov 14, 2011 · 2 revisions

Poker hand grammers

This is how i have been thinking about how to specify hands. Nothing fancy, it's mostly what i have read in poker books. I have not used many other poker calculators so if something looks the same but works totally different tell me about it; i want this application to be easy to pick up for anyone with or without experience. I have tried to write some regular expressions to better specify the different classes. I admit i am not that great with regular expressions; so if my description don't match the regexp, go with the description and examples.

[0-9]{1,2}%[as] : 15%a, 30%s..

The hands in the top xx percentile given Sklanskys or all in equity calculation rankings. Maybe there are more ways of doing it, but i cant think of any at the moment.

[AQJT9-2]x[os]{0,1} : Axo, Axs, Ax, Kxo, Kxs, Kx...

Axs matches all hands with an ace, and another card of the same suite as the ace, Kxo any hand with a king with unmatching suits, and Qx any hand with a queen. No pairs.

[AQJT9-2]{2,2}[os]{0,1}+{0,1} : AT, KJ, QTs, 67s+...

AT -> All hands with an ace and a ten.

ATs -> All suited hands with an ace and a ten.

JJo QQs would just be silly so lets make a special rule for pairs.

The plus sign is kind of ambiguous, but i believe the best way to handle it is 67+ generates 67, 78, 9T, TJ, QJ, KQ, AK; while Q9+ generates Q9, QT, QJ. The best way to separate them is either the distance between the cards, or the value of the first card (If the highest card jack or higher, go with the second interpretion. If the distance is 3 cards or greater, go with the second interpretion. I don't know; booth seem like they could work)

Pairs : TT, 66+, 66-TT

AA -> AhAc, AhAd, AhAs, AcAd, AcAs, AcAs

The plus sign means any pair higher then specified and including the specified pair. A dash is for a range of pairs, inclusive on both ends.

Do dashes make sence for unpaired hands, eg:

A2-AT -> A2, A3, A4, A5, A6, A7, A8, A9, AT

JT-K8 -> K8, K9, KT, KT, Q8, Q9, QT, QJ, J8, J9, JT

?

If the hole cards are visualized as a grid of 13x13 cards, with pairs along the diagonal, the suited hands one side of the pairs, and unsuited along the other. The x selects hands vertically if above the pair-line, the plus sometimes selects diagonally and sometimes vertically. In this visual metaphor the dash selects a grid with four corners, unless the corners are all pairs in which case it selects diagonally. 67s-K9o is stretching the metaphor too far and invalid.

Multiple boards

I have not yet figured out any good grammar for specifying multiple boards. The visual metaphor i introduced earlier breaks when taken to 3d (as there can be 3 suits) and is not visualize-able in 4 and 5 dimensions. Let me collect and go trough my notes and think some more about this.