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
Implementation notes: All of these parameters (betting
limits, number of raises, initial buyin, etc.) should be configurable
- We will be playing Texas Hold 'Em, a version of seven-card
stud poker similar to Spit in the Ocean.
In this form of poker, each player receives two private hole
cards, and then five common cards are dealt (in three
phases) and are shared by all players. Players make the best five-card
poker hand possible (see below) using one or both of their
hole cards and four or three, respectively, of the common cards.
- We will be playing limit poker, with a low and a high
limit. The low limit is used in the first two betting rounds of each
game and the high limit in the third and fourth rounds.
- We will be playing with a maximum number of raises in any
- We will be playing freeze out poker: each player buys
in to the game with some amount of cash, and the game continues
until one player has won the money. That is, no player can take money
off the table (except the final winner, of course).
- The dealer assigns seating positions to each player.
- The dealer assigns the button to one player, who is said to
be ``on the button.'' The button rotates clockwise from its initial
You can assume that before each game you will be told how many players
there are, their positions, and the position of the button.
- Each player antes one-half of the low betting limit into
the pot. We will round down to the nearest whole dollar (but not less
than one dollar).
Keeping track of the amount of money in the pot will probably help you
decide what to do later.
You will obviously need to represent the contents of your hand.
- The dealer deals two hole cards to each player.
First Betting Round
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 player on the button must make a blind bet equal to
one-half the low betting limit (round down), or tap out for the bet
- The next player must make a straddle bet equal to the low
betting limit (that is, they are raising one-half the low limit), or
they can fold, or they can tap out for the bet (see below).
- The next player has three options, assuming that previous bets
have left them N dollars behind:
There is a limit on the total number of raises by all players in a
single betting round (not including the straddle). If this limit is
reached, a player may only fold or call.
- fold: Drop out of the game, losing anything bet so far.
- call: Add N dollars to the pot.
- raise: Add (N + low limit) dollars to the pot.
- tap out: Only permitted if a player has less than
N dollars left. See below.
- This last step repeats for each succesive player until either
- (a) all players are paid up or tapped out; or
- (b) all but one player has folded, in which case that player wins
the pot immediately and the game is over.
- If a player cannot bet the full amount it takes to call (or make
the blind or straddle bet), they can bet all their remaining cash. The
player is then tapped out.
The player keeps playing but makes no more bets (and, in particular,
cannot raise). If the player wins the hand, they win only the amount
in the pot at the time they tapped out, and the remainder of the pot
goes to the 2nd-highest hand(s). The exact details are spelled out
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
Handling tapping out properly may require some effort, although much
of this may be on the part of the dealer.
Implementation notes: You obviously need to represent the common cards
also and use them in evaluating your hand.
- The dealer deals three common cards.
Second Betting Round
- Another betting round is held with the low betting limit, as
The Turn (a.k.a. Fourth Street)
- The dealer deals one more common card.
Third Betting Round
- Betting (including the first bet and all raises) in the third and
fourth rounds is at the high betting limit.
- There is no blind bet in the third and fourth betting rounds.
- Instead, the first-position player may check: bet nothing
and pass the decision to the next player. The next player may also
check. If all players check, the round is over (with nothing added to
the pot). If any player opens (by betting the high limit), no
more checks are allowed in that round.
- Once opened, betting proceeds as described above until all players
are paid up or only one player is left. Players can either call,
raise, fold, or tap out.
- If the game allows ``check and raise,'' then a player who
has checked may raise when the action comes around to them,
otherwise they may only call (or fold). After betting, a player
who has once checked may raise if the action returns to them
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 dealer deals one final common card.
- Another betting round is held with the high betting limit, as
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.
- The last player to have raised in the final betting round (or the
player who opened the betting, if there were no raises) is said to
be called and must show their hand.
- Each player remaining in the game may beat this hand by
showing and announcing a hand of a higher value.
- The player with the highest hand wins the pot. In the case of a
tie (exact rules in Cardoza or Scarne), the pot is split evenly.
Amounts are in whole dollars--odd amounts will be assigned by the
- An alternative version of the showdown is so-called ``cards
speak.'' Unless playing cards speak, if a player announces a
sub-optimal hand for their cards, the announced hand (rather than the
highest hand possible) is official.
- Handling distribution of the pot in the event of a tie when one or
more players have tapped out is tricky. We have developed the
- If no winning player has tapped out, the pot is split evenly as
- Otherwise, let each tied player Pi have an
expectation Ei. This is the amount that they can
(should) reasonably expect to win. For a non-tapped-out player, this
is the total amount of the pot. For a tapped-out player, it is the
amount in the pot if their bet had been the last bet made in the
hand. That is, the amount prior that betting round, plus all the
bets they covered up to and including their tap out bet. Note that this
includes players whose turn to bet came after the tapped out player
but who were calling or raising the tapped out player (although the
tapped out player's expectation only includes that part of those
players' bets that the tap out bet covered).
- Let the total of all tied players expectations be E (= sum
over i of Ei). Then, for each tied player Pi,
their share of the pot is Ei / E. Note that this handles the
special cases properly: a single winner has Ei = E and so wins
it all, n non-tapped-out winners each have Ei = E also,
and so win 1 / n of the pot, and tapped-out players get a share
proportional to how long they stayed in the game (i.e., to how much
they put in the pot before tapping out).
Handling the distribution of the pot is probably the dealers problem.
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.
- Initial buyin: $1000
- Low betting limit: $10 (implies: ante=$2, blind=$5, straddle=$10)
- High betting limit: $20
- Maximum number of raises per round, all players: 3
- Check-and-raise allowed
- Not playing ``cards speak''---players must announce their hands
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
- 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