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 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 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 cards off to the side
Both players check the next card on the top of their deck, whoever has the larger card takes all 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
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
