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

Advection-diffusion, You are to submit your completed MATLAB code and a sho...

You are to submit your completed MATLAB code and a short written report through the Blackboard upload facility as a single zip ?le. This zip ?le should consist of your ?nite volume

Airy equations, Need help programming in Matlab for airy equations

Need help programming in Matlab for airy equations

Mri - detecting defects in major ateries, MRI (magnetic resonance imaging) ...

MRI (magnetic resonance imaging) scanners allow doctors to now obtain complete body images for medical diagnosis purposes. The system produces scans which represent slices through

If-else statement, The IF-ELSE Statement: The if statement selects whe...

The IF-ELSE Statement: The if statement selects whether an action is executed or not. Selecting between the two actions, or selecting from numerous actions, is accomplished by

Program for add sinusoid with frequency, Job: Add sinusoid with frequency 1...

Job: Add sinusoid with frequency 1000 Hz and amplitude 100 to the one generated in Job 1 (: Create a function using mat lab to generate a sinusoidal signal. The parameters of the s

Write a matlab program, Write a MATLAB program that calculates the arithmet...

Write a MATLAB program that calculates the arithmetic mean, the geometric mean, and the root-mean-square average for a given set of values. Your program must use 3 functions t

Two phase moving boundary problem, This problem description is taken from I...

This problem description is taken from Illingworth and Golosnoy [1]: For physical systems of inhomogeneous composition, di usion is often observed to cause a change of phase, even

Find the dft frequency resolution, (a) Using Matlab, find and plot the magn...

(a) Using Matlab, find and plot the magnitude of the DTFT of 10 samples of x(n) for n=[0:1:9] of x(n) = cos(2*pi*f1*n) + cos(2*pi*f2*n)  for f1=0.22 and f2=0.24 and pad zeros to ge

Calculate displacement using indefinite integrals, Problem: A function ...

Problem: A function is given by Y= 2x3 + 3 x2 -12x + 5 a determine the finite values of x at which any local maximum of minimum occur and determine the corresponding val

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