Using the Deck and Card classes uploaded, implement the traditional children’s card game called War.(I WILL SEND THE FILES VIA EMAIL IF ITS OKAY)
The game of war works like:
Shuffle the deck and deal it out evenly to two players. (Each player’s cards should be held in an instance of Deck.)
Each player draws the top card and shows it.
The player with the higher rank card (ace high) takes both cards. Suits are ignored for this comparison.
If the two cards are equal, each player draws two more cards face down and then one more card face up. The player with the higher face-up card takes all eight cards currently drawn. If it is still a tie, each player draws two more face down cards and a third face-up card, with the winner taking all 14 cards, and so on, until the tie is broken.
All cards claimed in these battles go to the player’s discard pile (implemented as a list of cards.)
When a player’s active cards is empty, that player creates a new Deck their discard pile and shuffles that, which becomes their new active cards to be drawn from.
The game ends when one player has all the cards.
Your program should play for both players and report the progress of the game. Your output should look like:
Player 1 draws 5 of Hearts
Player 2 draws 7 of Spades
Player 2 wins 5 of Hearts, 7 of Spades
Player 1 draws King of Spades
Player 2 draws King of Hearts
TIE!
Player 1 draws two face down cards
Player 1 draws 9 of Clubs
Player 2 draws two face down cards
Player 2 draws 2 of Hearts
Player 1 wins King of Spades, 4 of Diamonds, Ace of Clubs, 9 of Clubs, King of Hearts, Jack of Diamonds, 6 of Diamonds, 2 of Hearts
The program should continue like this until one player wins.
Create two classes, one representing a player in the game and one representing the game as a whole. Please include all Javadocs and well commented on what behavior instances of each class will require and then what representation each class will need to accomplish those behaviors.
This task should be completed with well-commented code. Please comment all methods and functions.
Project ID:FS-11022-kazi
I can handle the work perfectly