Simplified Poker Game, MATLAB Programming

Assignment Help:
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.

Related Discussions:- Simplified Poker Game

Matrix inverse, how to find matrix inverse using matlab command

how to find matrix inverse using matlab command

Polynomial fitting, how can i used loops instead of polyfit function

how can i used loops instead of polyfit function

Logical operators, logical operators: The logical operators are as sho...

logical operators: The logical operators are as shown below: All the logical operators operate on Boolean or logical operands. The not operator is a unary operator; wh

Generate two waveforms-analog waveform, The purpose of this lab is to intro...

The purpose of this lab is to introduce students to the basic concept of overtones. In order to generate two tones at the same time, you need to generate two waveforms and add them

Calculate the signal-to-noise ratio, Use the MATLAB randn function to gener...

Use the MATLAB randn function to generate 1000 points for x. Generate the output of the unknown system with the ?lter function and b=[1232 1] and a=[1]. Normalise the ?lter output

Referring to and modifying elements, Referring to and Modifying Elements: ...

Referring to and Modifying Elements: The particular element in a vector is accessed by using the name of the vector variable and the element number (or subscript, or index) in

Adaptive filters, Adaptive filters can also be used in other applications. ...

Adaptive filters can also be used in other applications. Speech recognition, for example, is performed in a non-stationary environment, and therefore may require adaptive filtering

Create a model or spreadsheet in matlab, The pressure radiated by a column ...

The pressure radiated by a column of in-phase monopole sources may be expressed as: Create a model (spreadsheet / MATLAB etc) for a 6 element column, where d=0.2m . Figure

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd