Question: Modify the following program so that the card dealing function deals a five-card poker following additional functions: 1. Determine weather the hand contains a pair
Modify the following program so that the card dealing function deals a five-card poker following additional functions:
1. Determine weather the hand contains a pair
2. Determine weather the hand contains a two paris
3. Determine weather the hand contains three of a kind
4. Determine weather the hand contains four of a kind
5. Determine weather the hand contains a flush
6. Determine weather the hand contains a striaght

18 / initialize suit array 19 const char *suit SUITS ] = 20 "Hearts", "Diamonds", "Clubs", "Spades" } 21 22 I initialize face array 23 const char * face FACES ] = "Ace", "Deuce", "Three", "Four ", 25 Five Six 'Seven Eight 26 Nine Ten Jack ueen 'King 27 28 // initialize deck array 29 unsigned int deck SUITS ] ( FACES ] = { 0 }; 30 31srand C time ( NULL ) ) ; I I seed random-number generator 32 33 shuffled deck ) ; I shuffle the deck 34 dealC deck, face, suit ) ; I / deal the deck 35} // end main 36 37 // shuffle cards in deck 38 void shuffle unsigned int wDeck[][ FACES ] ) 39 { 40 size_t row; I / row number 41 size_t column; / column number 42 sizet card; I / counter 43 44 IN for each of the cards, choose slot of deck randomly 45 for ( card = 1; card
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
