Skip to contents

Interact with the game by typing commands into the console and pressing enter.

Usage

play_poker(colors = c(2, 4, 1))

Arguments

colors

One of 1, 2, or 4. The number of colors to use to render the suits.

  • For 1, all suits are the default console color.

  • For 2, hearts and diamonds are red and spades and clubs are the default console color.

  • For 4, hearts are red, clubs are green, diamonds are blue, and spades are the default console color.

Value

Generates an interactive game of poker in the console.

Scoring

HandPointsDescription
Junk-10Nothing of value.
Low pair0Two cards of the same rank, ten or below.
High pair5Two aces, kings, queens, or jacks.
Two pair10Two cards of one rank and two cards of another.
Three of a kind20Three cards of the same rank.
Straight50Five cards in sequential order.
Flush75Five cards of the same suit.
Full house100Three cards of one rank and two cards of another.
Four of a kind1,000Four cards of the same rank.
Straight flush50,000Five cards of the same suit in sequential order.
Royal flush1,000,000Ace, king, queen, jack, and ten of the same suit.

For straights, aces may be considered the highest card (above king) or the lowest card (below two). However, aces may not be used to connect a king and a two (e.g. Q-K-A-2-3 is not a straight).

Examples

play_poker()
play_poker(colors = 4)
play_poker(colors = 1)