Question: Create a game of war for 2 computer players. The code should work almost exactly the same as a real card game of War using

Create a game of war for 2 computer players. The code should work almost exactly the same as a real card game of War using the
following procedure:
Shuffle the deck (randomly)
Deal out all the cards to that each player has 26(deck excludes jokers)
Both players check their top card, whoever has the highest card takes both cards and adds them to the bottom of their hand.
If the cards are equal then it's WAR
WAR:
Each player places 3 cards off to the side
Both players check the next card on the top of their deck, whoever has the larger card takes all 8 cards
If it is a tie, repeat WAR
If a player runs out of cards at any given time, they lose (even if it's the middle of WAR)
Please write the code in MATLAB for the app designer with comments explaining your steps
 Create a game of war for 2 computer players. The code

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!