5 card poker scoring

broken image
broken image

Getting a flush or full house is truly rare. Single pairs may also appear, but mostly you get a lot of high-card hands. The output you see above is most typical. Your hand is A♣ 6♦ 8♥ K♣ 9♦ - High card: A♣ Wprintf(L' - High card: %s%lc\n',hand.face,hand.suit) So I fixed up the relevant part of code: /* account for ace as the high card */ Whoops! I noticed that my high-card if test doesn’t count for the value of an Ace as 1, low. You can see that the output is unsorted, through internally the code sorts the hand by card value, which is what the various evaluation functions expect. I think the code is nifty, but the output shows you how long the odds are on a typical 5-card hand of poker. With all the hand-ranking functions complete (see last week’s Lesson), the final version of my poker program restores the randomizer, draws and sorts a hand, then outputs the hand’s value.

broken image