Rules of Hold 'Em Poker for Computers (and people too!)

Based on How to Play Winning Poker by Avery Cardoza (ISBN 0-940685-04-3) and Scarne's Guide to Modern Poker by John Scarne (ISBN 0-617-53076-3). Adapted for URCS by George Ferguson and Chris Brown.

Preliminaries

Implementation notes: All of these parameters (betting limits, number of raises, initial buyin, etc.) should be configurable at runtime.

You can assume that before each game you will be told how many players there are, their positions, and the position of the button.

The Ante

Implementation notes: Keeping track of the amount of money in the pot will probably help you decide what to do later.

The Pre-Flop

Implementation notes: You will obviously need to represent the contents of your hand.

First Betting Round

Implementation notes: There is a lot of state involved in a betting round. However, a single player need only track how much they owe to the pot and, in their turn, make the decision to fold, call, or raise (at the appropriate limit). One might even be able to assume that the dealer would keep track of what you owe and tell you...

The decision to fold, call, or raise depends on the quality of your hand, among other factors. So you obviously must be able to evaluate hand quality.

Handling tapping out properly may require some effort, although much of this may be on the part of the dealer.

The Flop

Implementation notes: You obviously need to represent the common cards also and use them in evaluating your hand.

Second Betting Round

The Turn (a.k.a. Fourth Street)

Third Betting Round

Implementation notes: Checking is a way for the players with early positions to gain some ``positional advantage'' (that is, knowing the actions of other players before acting themselves). Positional play is a key to success, according to the experts.

The River (a.k.a. Fifth Street)

The Showdown

Implementation notes: To participate in the showdown, you need to be able to compare your hand to others. You can assume that the dealer will be checking that player's cards support their stated value.

Handling the distribution of the pot is probably the dealers problem.


Default Parameters

The following default parameters will in all probability be used for our tournamment games. Programs should be designed to configure these parameters at runtime, however, rather than only being able to play with one set of parameters.


Rank of Hands for Poker

1. Straight Flush:
Five cards of the same suit in sequential (rank) order. Ace can be high or low. Straight flushes are compared by comparing the rank of their highest card (e.g., queen-high beats seven-high). An ace-high straight flush is also called a royal flush and cannot be beaten (but can be tied).
2. Four of a Kind:
Four cards of the same rank. Compared by comparing their rank. The fifth card is not used in comparing four-of-a-kinds (not that it matters in a game without wildcards).
3. Full House:
Three cards of one rank and two cards of another rank. Compared by comparing the ranks of the three-of-a-kinds (e.g., ``7 7 7 2 2'' beats ``5 5 5 A A''). Note that there cannot be ties between three-of-a-kinds (in a game without wildcards).
4. Flush:
Five cards of the same suit. Compared by comparing the ranks of the five cards from highest to lowest (e.g., ``Q 10 9 5 3'' beats ``Q 10 8 7 6'').
5. Straight:
Five cards in sequential (rank) order. Aces can be high or low. Compared by comparing the rank of their highest card.
6. Three of a Kind:
Three cards of the same rank. Compared by comparing the ranks. The other two cards are not used in comparing three-of-a-kinds.
7. Two Pair:
Two pairs of cards, each of the same rank. Compared by comparing the ranks of the highest pairs, then the ranks of the lowest pairs, and finally the ranks of the fifth card.
8. One Pair:
One pair of cards of the same rank. Compared by comparing the ranks of the pairs, then the ranks of the highest third cards, then the next highest cards, and finally the lowest odd card.
9. High Card:
Five cards not meeting any of the other categories. Compared by comparing the ranks of each hand's highest card, then their second highest, and so on to the lowest card in each hand.


Last change: 9 Dec 1998 by ferguson