You can assume that all hands are valid (no invalid characters or repeated cards), each player's hand is in no specific order, and in each hand there is a clear winner.ĬardMask converts a string to a 64 bit integer bitmask: The file, poker.txt, contains one-thousand random hands dealt to two players.Įach line of the file contains ten cards (separated by a single space): the first five are Player 1's cards and the last five are Player 2's cards. If the highest cards tie then the next highest cards are compared, and so on.Ĭonsider the following five hands dealt to two players: If two players have the same ranked hands then the rank made up of the highest value wins įor example, a pair of eights beats a pair of fives (see example 1 below).īut if two ranks tie, for example, both players have a pair of queens, then highest cards in each hand are compared (see example 4 below) The cards are valued in the order: 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King, Ace. Royal Flush: Ten, Jack, Queen, King, Ace, in same suit. Straight Flush: All cards are consecutive values of same suit. Straight: All cards are consecutive values.įour of a Kind: Four cards of the same value. Three of a Kind: Three cards of the same value. In the card game poker, a hand consists of five cards and are ranked, from lowest to highest, in the following way:
0 Comments
Leave a Reply. |