Question
Using JAVA create: Card Game: Game of War Create a card game application and classes with the following capabilities: Use Enums for the suit and
Using JAVA create:
Card Game: Game of War
Create a card game application and classes with the following capabilities:
Use Enums for the suit and value of a card
Include sort() (a hand) and shuffle() (a deck) methods
Add a dealCard() method Deck class
Modify the GroupOfCards to be an abstract class
Create a class called GameOfWar that has three methods:
initialize()
play()
displayWinner()
Create a GameDriver class that asks the user if he/she wants to play a game and then instantiates a GameOfWar object where the actual game is played (see above).
Use a constant to hold the number of rounds to play. Use this to verify that your application is working correctly.
Make sure you have a placeholder for the pile of cards that are being compared
Make sure you have a placeholder for each players pile as they win rounds
Create the methods to play the actual game of War. This should include the following:
Splitting the deck (each player should have 26 cards to start)
Comparing the top card from each player
Determining a winner and putting the cards into the winning players pile
Handling the scenario where a player (or both) has no more cards in his/their hand
At this point the players pile should become the players hand
Make sure that your cards come out in the proper order when you turn the pile over
Handling the scenario of War where the players cards are the same value. In this scenario, make sure the following is done:
Each player adds their next three cards to the pile and then turns over/compares their fourth card
The winner of the fourth card comparison wins all the cards
If there is a tie, this scenario continues
Playing until the game ends (one player has all the cards) or the number of rounds played => the number of rounds constant
Determining who is the winner of 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