Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started