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

Generate a matlab error with a descriptive error message, Write a function ...

Write a function called threshold2 (in a file called 'threshold2.m'). The function takes an arbitrary number of input variables. The first input variable, t, is required and is the

Matlab programming, Obtaining the Partial Fraction Expansion of the Z-Trans...

Obtaining the Partial Fraction Expansion of the Z-Transform expression and to find its Inverse Z-Transforms using MATLAB

2D steady state heat conduction, How do I compute and plot a temperature pr...

How do I compute and plot a temperature profile along the x axis from -6 to 6 given the equation for steady state heat conduction and boundary conditions

Illustration of script documentation, Illustration of script Documentation:...

Illustration of script Documentation: For illustration, the script to compute the area of a circle could be modified to have comments: The first comment at the startin

ANFIS, how to design a digital fir filter using anfis in matlab.get the cod...

how to design a digital fir filter using anfis in matlab.get the code for that.

Writing data to a file, Writing data to a File: The save function can ...

Writing data to a File: The save function can be used to write a data from the matrix to the data file, or to append a data file. The format is as shown below: save filenam

Implement the physat algorithm in matlab, Your task is to implement the PHY...

Your task is to implement the PHYSAT algorithm in Matlab to classify the phytoplankton species in the data you have selected. An algorithm demonstrating one solution is provided be

Write a computer program using matlab, From A to B the inlet valve is open ...

From A to B the inlet valve is open and the steam pressure increases linearly from 0.1000 MPa absolute to 15.00 MPa absolute, 1000°C. The inlet valve closes and from B to C the

variable names, Variable names: Variable names are an example of the ...

Variable names: Variable names are an example of the identifier names. The rules for identifier names are as shown below: (A)The name should begin with a letter of the alph

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