Poker Game Use the functions developed in exercise 7.24 in the book to write a program that deals two five-card poker hands, evaluates each, and determines which is the better hand. Create functions...

The below cod is the code that it’s mentioned in the question. Write your cod and show it in a picture, please.Poker Game<br>Use the functions developed in exercise 7.24 in the book to write a program that deals two<br>five-card poker hands, evaluates each, and determines which is the better hand.<br>Create functions that:<br>a. Determine whether the hand contains a pair.<br>b. Determine whether the hand contains two pairs.<br>c. Determine whether the hand contains three of a kind (e.g., three jacks).<br>d. Determine whether the hand contains four of a kind (e.g., four aces).<br>e. Determine whether the hand contains a flush (i.e., all five cards of the same suit).<br>f. Determine whether the hand contains a straight (i.e., five cards of consecutive face<br>values).<br>I have attached the code at the for exercise 7.24 however I do recommend that you read through<br>the chapter in order to better understand why the algorithm is written up that way.<br>

Extracted text: Poker Game Use the functions developed in exercise 7.24 in the book to write a program that deals two five-card poker hands, evaluates each, and determines which is the better hand. Create functions that: a. Determine whether the hand contains a pair. b. Determine whether the hand contains two pairs. c. Determine whether the hand contains three of a kind (e.g., three jacks). d. Determine whether the hand contains four of a kind (e.g., four aces). e. Determine whether the hand contains a flush (i.e., all five cards of the same suit). f. Determine whether the hand contains a straight (i.e., five cards of consecutive face values). I have attached the code at the for exercise 7.24 however I do recommend that you read through the chapter in order to better understand why the algorithm is written up that way.
#include <stdio.h><br>#include <stdlib.h><br>8<br>9<br>10 #include <time.h><br>#define SUITS 4<br>11<br>12<br>#define FACES 13<br>13 #define CARDS 52<br>1 // prototypes<br>15 void shuffle(unsigned int wDeck [) [FACES]); // shuffling modifies wDeck<br>16 void deal (unsigned int weck[] [FACES], const char *wFace[],<br>17 const char *wSuit[]); // dealing doesn't modify the arrays<br>18 int main(void){<br>19 // initialize deck array<br>20 unsigned int deck [ SUITS] [FACES] = {0};<br>srand (time (NULL)); // seed random-number generator<br>shuffle(deck); // shuffle the deck<br>// initialize suit array<br>24<br>19 77<br>21<br>A Implicit conversion loses integer precision: 'time_t' (aka 'long') to 'unsig<br>23<br>const char *suit[SUITS] =<br>{

Extracted text: #include #include 8 9 10 #include #define SUITS 4 11 12 #define FACES 13 13 #define CARDS 52 1 // prototypes 15 void shuffle(unsigned int wDeck [) [FACES]); // shuffling modifies wDeck 16 void deal (unsigned int weck[] [FACES], const char *wFace[], 17 const char *wSuit[]); // dealing doesn't modify the arrays 18 int main(void){ 19 // initialize deck array 20 unsigned int deck [ SUITS] [FACES] = {0}; srand (time (NULL)); // seed random-number generator shuffle(deck); // shuffle the deck // initialize suit array 24 19 77 21 A Implicit conversion loses integer precision: 'time_t' (aka 'long') to 'unsig 23 const char *suit[SUITS] = {"Hearts", "Diamonds", "Cclubs", "Spades"}; 26 // initialize face array const char *face[FACES] 28 {"Ace", "Deuce", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King"}; 29 deal (deck, face, suit); // deal the deck 27 %3D 30 } 31 32 33 // shuffle cards in deck 34 void shuffle(unsigned int wDeck[][FACES]){ 35 // for each of the cards, choose slot of deck randomly for (size_t card = 1; card <= cards;="" ++card)="" {="" size_t="" row;="" row="" number="" size_t="" column;="" column="" number="" choose="" new="" random="" location="" until="" unoccupied="" slot="" found="" 36="" 37="" 38="" do="" {="" row="rand" ()="" %="" suits;="" column="rand" ()="" %="" faces;="" 40="" 41="" 42="" 43="" }="" while(wdeck[="" row]="" [column]="" !="0);" 44="" place="" card="" number="" in="" chosen="" slot="" of="" deck="" wdeck[row][column]="card;" }="" 45="" aimplicit="" conversion="" loses="" integer="" precision:="" 'size_t'="" (aka="" 'unsigned="" long')="" to="" 'unsig="" 46="" 47="" }="" deal="" cards="" in="" deck="" 48="" 49="" void="" deal="" (unsigned="" int="" wdeck="" []="" [faces],="" const="" char="" *wface[],="" const="" char="" *wsuit[]){="" 50="" deal="" each="" of="" the="" cards="" for="" (size_t="" card="1;" card=""><= cards;="" ++card)="" {="" 51="" 52="" loop="" through="" rows="" of="" wdeck="" for="" (size_t="" row="0;" row="">< suits;="" ++row)="" {="" 53="" 54="" loop="" through="" columns="" of="" wdeck="" for="" current="" row="" 55="" for="" (size_t="" column="0;" column="">< faces; ++column) { 56 // if slot contains current card, display card 57 if (wdeck[row][column] == card) { printf("%5s of %-8s%c", wface[column], wsuit[row],card % 2 == 0 ? '\n': '\t'); // 2-column format faces;="" ++column)="" {="" 56="" if="" slot="" contains="" current="" card,="" display="" card="" 57="" if="" (wdeck[row][column]="=" card)="" {="" printf("%5s="" of="" %-8s%c",="" wface[column],="" wsuit[row],card="" %="" 2="=" 0="" '\n':="" '\t');="" 2-column="">
Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here