Texas Hold'Em Poker

 

For this portion of the assignment you are to write a Texas Hold'Em Poker card game in Java utilizing a graphical user interface.  It is assumed that you have successfully implemented the Card, Deck, Hand, Rank, and Suit classes that are to be used with this program.

The Deck and Deal. The standard 52-card deck is used. A dealer is selected among the players and given a red button. This red button indicates that the player is the assigned dealer for the current round of the game. Upon completion of the round, the button is passed one player to the left and that person becomes the assigned dealer for the next round.

Object of the Game. The goal of each player is to win the pot which contains all the bets that the players have made in any one deal. A player makes a bet in hopes that he has the best hand, or to give the impression that he does.  Players are dealt two cards facedown, and (by the end of the round) five community cards are placed face up in the middle of the table. Each player's hand is determined by using the best five cards of the seven. The rank of hands (highest to lowest) is as follows:

Straight Flush. This is the highest possible hand. A straight flush consists of five cards of the same suit in sequence, such as 10, 9, 8, 7, 6 of hearts. The highest-ranking straight flush is the A, K, Q, J, and 10 of one suit, and this combination has a special name: a royal flush or a royal straight flush.

Four of a Kind. This is the next highest hand, and it ranks just below a straight flush. An example is four aces or four 3s. It does not matter what the fifth, unmatched card is.

Full House. This colorful hand is made up of three cards of one rank and two cards of another rank, such as three 8s and two 4s, or three aces and two 6s.

Flush. Five cards all of the same suit, but not all in sequence, is a flush. An example is Q, 10, 7, 6, and 2 of clubs.

Straight. Five cards in sequence, but not all of the same suit is a straight. An example is [Spade Symbol]9, [Diamond Symbol]8, [Diamond Symbol]7, [Heart Symbol]6, [Spade Symbol]5.

Three of a Kind. This combination contains three cards of the same rank, and the other two cards each of a different rank, such as three jacks, a seven, and a four.

Two Pairs. This hand contains a pair of one rank and another pair of a different rank, plus any fifth card of a different rank, such as Q, Q, 7, 7, 4.

One Pair. This frequent combination contains just one pair with the other three cards being of different rank. An example is 10, 10, K, 4, 3.

No Pair. This very common hand contains "nothing." None of the five cards pair up, nor are all five cards of the same suit or consecutive in rank. When more than one player has no pair, the hands are rated by the highest card each hand contains, so that an ace-high hand beats a king-high hand, and so on.

Two hands that are identical, card for card, are tied since the suits have no relative rank in Poker. In such a case, the tied players split the pot. Note that if two hands contain the same high pair, then the ranking of the next card in the hands determines which one wins. For example: 9, 9, 7, 4, 2 beats 9, 9, 5, 3, 2. Likewise, two hands that have identical pairs would be decided by the fifth card. For example: Q, Q, 6, 6, J beats Q, Q, 6, 6, 10.

Making the Rounds. There are four betting rounds in Texas Hold'em. Betting always proceeds clockwise among the players.

Initial Bets: Before dealing any cards, "blind" bets are made by the two players to the left of the dealer. These bets are called the "small blind" and the "big blind," respectively.

First Round: Each player is dealt two cards, called "hole cards," facedown. The player to the left of the "big blind" can fold, call, or raise the bet. Betting proceeds clockwise around the table.

Second Round: The dealer places three community cards face up on the table. These cards are called "the flop." The player to the left of the red button begins the betting round. Players can now check if there is no bet ahead of them. If there is a bet ahead of them, they can fold, call, or raise the bet.

Third Round: The dealer places another face up community card, called "the turn" or "Fourth Street," in the center of the table. Betting continues clockwise.

Final Round: The dealer places the last face up community card, called "the river" or "Fifth Street," in the center of the table. This fourth and final round of betting continues clockwise. The winner is the player with the best five-card hand selected from the two player cards and five community cards. (Someone may also win the pot by betting and no one calling before completion of the betting round.)

Sequence of Play:

1.      The Players to the left of the Dealer begin by posting the blind bets.

2.      Two pocket cards are dealt to each Player - face-down

3.      First round of betting - options are to fold, bet, or raise.  Only one bet, and three raises per Player are allowed on the first round.  Players cannot "check" in the first round, as Blinds are bets, and not antes.

4.      Three communal cards (flop) are dealt face-up in the center of the table. All communal cards are active for all Players and can be used in combination with each Player's two cards.

5.      Second round of betting - options are to check, fold, bet, or raise.

6.      Fourth communal card (Turn) is dealt face-up.

7.      Third round of betting - options are to check, fold, bet, or raise.

8.      If, at this stage, there are still at least two vying Players, the fifth, and final communal card (River) is dealt face-up.

9.      Final round of betting follows.

10.  The Showdown! All remaining Players then create the best five-card hand possible. You can use:  both pocket cards and three communal cards or one pocket card and four communal cards or all five communal cards

11.  The best hand wins the pot! If two or more Players have the same winning hand, the pot is split equally between them.

 Betting Rules:

1.      As per normal poker rules - playing and betting proceeds in a clockwise direction.

2.      The two Players to the left of the Dealer post the blind bets.

3.      Small Blind (the Player who sits left of the Dealer) bets half the lower limit.

4.      Big Blind (the Player who sits left of the Small Blind) bets equal to the lower limit.

5.      Betting increments in the game determine the blinds. In a game of $2 and $4 betting increments, the small blind is $1, and the big blind is $2.

6.      The blind bets in Texas Hold'em are considered as active bets, and therefore, Players have the option to check, fold, call, and raise when the betting action returns to their position. (Exception to first round betting). First round betting - options are to fold, bet, or raise.  Only one bet, and three raises per Player are allowed on the first round.  Players cannot "check" in the first round, as Blinds are bets, and not antes.

7.      Second and subsequent betting rounds - options are to check, fold, bet, or raise.

8.      All bets must be placed in conjunction with the game's betting increments.

9.      There are four possible betting rounds in Texas Hold'em poker. Each bet and raise during the first two rounds is set at the lower limit of the stakes structure, and for the last two rounds at a higher limit structure. For example in a $1/$2 Texas Hold'em game, all bets and raises are $1 for the first two rounds (after pocket cards are dealt and after the flop). All bets and raises are $2 for the last two rounds (after the turn and after the river), following accepted poker rules.

10.  The maximum allowable number of bets per Player during any betting round in Texas Hold'em poker is four. This includes a (1) bet, (2) raise, (3) re-raise, and (4) cap. The term cap is used to describe the 3rd raise in a round since betting is then capped and can't be raised further. Once capped, Players will have only the option of calling or folding.

11.  In betting rounds where Players have folded, the first active Player left of the Disc/Dealer is first to act.

GLOSSARY

ACTION: A fold, check, call, bet, or raise. For certain situations, doing something formally connected with the game that conveys information about your hand may also be considered as having taken action. Examples would be showing your cards at the end of the hand, or indicating the number of cards you are taking at draw.

AGGRESSIVE ACTION: A wager that could enable a player to win a pot without a showdown; a bet or raise.

ALL-IN: When you have put all of your playable money and chips into the pot during the course of a hand, you are said to be all-in.

ANTE: A prescribed amount posted before the start of a hand by all players.

BET: The act of placing a wager in turn into the pot on any betting round, or the chips put into the pot.

BIG BLIND: The largest regular blind in a game.

BLIND:  A required bet made before any cards are dealt.

BLIND GAME: A game which utilizes a blind.

BOARD: (1) The board on which a waiting list is kept for players wanting seats in specific games.  (2) Cards face up on the table common to each of the hands.

BOARDCARD:  A community card in the center of the table.

BUTTON: A player who is in the designated dealer position. See dealer button.

BUTTON GAMES: Games in which a dealer button is used.

BUY-IN: The minimum amount of money required to enter any game.

CAPPED: Describes the situation in limit poker in which the maximum number of raises on the betting round have been reached.

CHECK: To waive the right to initiate the betting in a round, but to retain the right to act if another player initiates the betting.

CHECK-RAISE: To waive the right to bet until a bet has been made by an opponent, and then to increase the bet by at least an equal amount when it is your turn to act.

COMMUNITY CARDS: The cards dealt face up in the center of the table that can be used by all players to form their best hand in the games of holdem and Omaha.

DEAL: To give each player cards, or put cards on the board. As used in these rules, each deal refers to the entire process from the shuffling and dealing of cards until the pot is awarded to the winner.

DEALER BUTTON: A flat disk that indicates the player who would be in the dealing position for that hand (if there were not a house dealer). Normally just called “the button.”

DECK: A set of playing-cards.

DOWNCARDS:  Cards that are dealt facedown in a stud game.

DRAW: (1) The poker form where players are given the opportunity to replace cards in the hand. In some places like California, the word “draw” is used referring to draw high, and draw low is called “lowball.”  (2) The act of replacing cards in the hand.  (3) The point in the deal where replacing is done is called “the draw.”

FACECARD: A king, queen, or jack.

FIXED LIMIT: In limit poker, any betting structure in which the amount of the bet on each particular round is pre-set.

FLOP: The three community cards that are turned simultaneously after the first round of betting is complete.

FLUSH: A poker hand consisting of five cards of the same suit.

FOLD: To throw a hand away and relinquish all interest in a pot.

FOURTH STREET: The second upcard in seven-card stud or the first boardcard after the flop in hold’em (also called the turn card).

FORCED BET: A required wager to start the action on the first betting round (the normal way action begins in a stud game).

FULL HOUSE: A hand consisting of three of a kind and a pair.

HAND: (1) All a player’s personal cards.  (2) The five cards determining the poker ranking.  (3) A single poker deal.

HOLECARDS: The cards dealt facedown to a player.

NO-LIMIT:  A betting structure where players are allowed to wager any or all of their chips in one bet.

OPENER: The player who made the first voluntary bet.

OPTION: The choice to raise a bet given to a player with a blind.

PASS: (1) Decline to bet. In a pass-and-out game, this differs from a check, because a player who passes must fold.  (2) Decline to call a wager, at which point you must discard your hand and have no further interest in the pot.

PLAY THE BOARD: Using all five community cards for your hand in hold’em.

POSITION: (1) The relation of a player’s seat to the blinds or the button.  (2) The order of acting on a betting round or deal.

POT-LIMIT: The betting structure of a game in which you are allowed to bet up to the amount of the pot.

RAISE: To increase the amount of a previous wager. This increase must meet certain specifications, depending on the game, to reopen the betting and count toward a limit on the number of raises allowed.

RERAISE: To raise someone’s raise.

SHOWDOWN: The final act of determining the winner of the pot after all betting has been completed.

SHUFFLE: The act of mixing the cards before a hand.

SMALL BLIND: In a game with multiple blind bets, the smallest blind.

SPLIT POT: A pot that is divided among players, either because of a tie for the best hand or by agreement prior to the showdown.

STACK: Chips in front of a player.

STRAIGHT: Five cards in consecutive rank.

STRAIGHT FLUSH: Five cards in consecutive rank of the same suit.

STREET: Cards dealt on a particular round in stud games. For instance, the fourth card in a player’s hand is often known as fourth street, the sixth card as sixth street, and so on.

TURNCARD: The fourth street card in hold'em.

UPCARDS: Cards that are dealt face up for opponents to see in stud games.

WAGER: (1) To bet or raise. (2) The chips used for betting or raising.