the game of simplied poker is a simple game by


The game of Simpli ed Poker is a simple game by today''s standards. You start o with a standard
deck of cards, shue the cards, and then give each player 3 cards. Each card has a face value: Aces are worth 14, Kings
are worth 13, Queens are worth 12, Jacks are worth 11, and 2 through 10 are worth 2 through 10, respectively. If all of a
player''s cards have the same value, then the player has three of a kind. If only two of a player''s cards have the same value,
then the player has two of a kind. If no two of a player''s cards have the same value, then the card with the highest value is
the high card. In determining the winner, a three of a kind beats a two of a kind, and a two of a kind beats a high card. If
two or more players have a three of a kind, or two of a kind, then the player with the higher valued two of a kind or three of
a kind wins. It is possible for two or more players to win if they each have the same two of a kind or high card. At the end
of each round, all winners will say their personal catchphrase. To play another hand, shue the deck again and start over.
1. Write, and properly comment code to allow users to play Simpli ed Poker.
2. Your code should allow for X players, where 0  X  15, and 2 hard-coded computer players to play Simpli ed
Poker.
3. Each player has his or her own catchphrase and name. In the beginning of your code, you should input each user''s
catchphrase and name. The computer players'' catchphrases and names should be hard-coded.
4. Store all of the players'' names and their catch phrases in a single struct.
5. I have provided you with two functions that should help:
(a) getDeck.m : This function will return a struct for an entire deck of cards. You can use the command
\deck=getDeck;" to de ne a struct deck.
(b) shueDeck.m : This function will input a struct and randomize its order. You can use the command
\deck=shueDeck(deck);" to shue the deck previously de ned by getDeck.
6. At the beginning of each hand, shue the deck and assign 3 cards to each player. Then use the disp command to
display each player''s cards.
7. To see who won a particular hand, you will need to rst check to see if someone won with three of a kind. If there
are no three of a kinds, then check for two of a kind winners. Finally, if there are no three of a kinds or two of a
kinds, check to see which player has the highest card. (Remember, more than 1 player can win a round.)
8. Output which players have won and have them say their catchphrases via the disp command.
9. Finally, ask the user if they want to play again, and if they say yes, start another round. The user should not have
to re-enter the plauers'' names and catchphrases.

Request for Solution File

Ask an Expert for Answer!!
Applications of MATLAB: the game of simplied poker is a simple game by
Reference No:- TGS0267342

Expected delivery within 24 Hours