Question: Simulate a two person card game of War in java until someone wins. Use only ArrayLists to store the cards in the program. There is
Simulate a two person card game of War in java until someone wins. Use only ArrayLists to store the cards in the program. There is no user input needed.
In War you have a standard deck of 52 cards that is dealt so that both players have 26 cards.During each round of play (or "battle"), both players play a card from the top of their hand face up. The player who plays the card of the higher rank wins both cards and places them at the bottom of his stack of cards. If both cards played are of the same rank, then both players play three additional cards face down and then one more card face up (this is called a "war"). The player who wins the war by playing the higher card wins all ten cards. If the ranks are still the same, additional wars are played until one player wins the turn. If either player runs out of cards to play, he loses the game.
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
