Skip to content

taegoodboy/Poker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Poker Progam

Poker is a family of card games involving betting and individual play, whereby the winner is determined by the ranks and combinations of their cards, some of which remain hidden until the end of the game. Poker games vary in the number of cards dealt, the number of shared or "community" cards and the number of cards that remain hidden. The betting procedures vary among different poker games in such ways as betting limits and splitting the pot between a high hand and a low hand.

How to play

  1. Input number of players between two to five players.
  2. Program will distribute random card to all players, five cards per players.
  3. Program will calculate to find the winner and show the winner's rank of cards results.

Rank of poker hands

In poker, players construct hands of five cards according to predetermined rules, which vary according to which variant of poker is being played. These hands are compared using a hand ranking system that is standard across all variants of poker, the player with the highest-ranking hand winning that particular deal in most variants of poker. In some variants, the lowest-ranking hand can win or tie.

The following rules apply to the ranking of all poker hands. Under typical rules there are nine distinct rankings.

  • Straight Flush
  • A straight flush is a hand that contains five cards in sequence, all of the same suit.

  • Four of a kind
  • Four of a kind, also known as quads, that contains all four cards of one rank and any other (unmatched) card. Quads with higher-ranking cards defeat lower-ranking ones.

  • Full house
  • A full house, also known as a full boat,that contains three matching cards of one rank and two matching cards of another rank. Between two full houses, the one with the higher-ranking three cards wins.

  • Flush
  • A flush is a poker hand where all five cards are of the same suit, but not in sequence. Two flushes are compared as if they were high card hands; the highest-ranking card of each is compared to determine the winner.

  • Straight
  • A straight is a poker hand that contains five cards of sequential rank in at least two different suits. Two straights are ranked by comparing the highest card of each. Two straights with the same high card are of equal value, suits are not used to separate them.

  • Three of a kind
  • Three of a kind, also called trips or a set, is a poker hand that contains three cards of the same rank, plus two cards which are not of this rank nor the same as each other.

  • Two pair
  • A poker hand that contains two cards of the same rank, plus two cards of another rank (that match each other but not the first pair), plus any card not of either rank, is called two pair. To rank two hands both containing two pair, the higher-ranking pair of each is first compared, and the higher pair wins.

  • One pair
  • One pair is a poker hand that contains two cards of one rank, plus three cards which are not of this rank nor the same as each other. Higher-ranking pairs defeat lower-ranking pairs; if two hands have the same pair, the non-paired cards are compared in descending order to determine the winner.

  • High card
  • A high-card or no-pair hand is a poker hand made of any five cards not meeting any of the above requirements. Essentially, no hand is made, and the only thing of any potential meaning in the hand is the highest card. Nevertheless, they sometimes win a pot if the other players fold or even at a showdown. Two high-card hands are ranked by comparing the highest-ranking card. If those are equal, then the next highest-ranking card from each hand is compared, and so on until a difference is found.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages