Question: Use the randperm function to shuffle the deck. You want it to produce a vector with the numbers 1 - 5 2 , with no
Use the randperm function to "shuffle" the deck. You want it to produce a vector with the numbers with no repeats, in random order. Use the help function to see how to use randperm.
Have an outer for loop over players and an inner for loop over cards. Start with the first element of the deck vector and each time you need a new card, advance to the next element.
Use the rem function to determine the rank of each card. The remainder after dividing a card number by will be in the range Add one to get the range Rank is an Ace, ranks are Jack, Queen, King, respectively, and the rest are the numbered ranks.
Use division by and the ceil rounding function to determine the suit of each drawn card Clubs, Diamonds, Hearts, Spades
Once you know the suit and rank of the current card, print it to the command window one card per line as in the example above.
Turn in your mfile containing your code. The usual indenting and commenting rules apply.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
