Question
In todays lab, you need to write a Simplified War game. The goal of War game is to be the first player to win all
In todays lab, you need to write a Simplified War game.
The goal of War game is to be the first player to win all 52 cards
The Deal
The deck deal cards evenly, with each player receiving 26 cards.
The Play
Each player plays a card at the same time. Cards will be displayed at the discard pile. Then the player with the higher card takes both cards and puts them on the bottom of his stack.
If the cards are the same rank, it is War. The cards will be put back to each players hand in a random position. You need to show the current number of cards in each players hand at the game screen. The game ends when one player has won all the cards.
Implementation requirements:
1.You need to build use friendly interface for the game.
2.You need to have Card, Deck, Hand classes.
3.You can reuse the card image or classes from previous lab.
4.Separate the game logic from the game interface classes and follow high cohesion and low coupling principle.
5.You can add necessary any buttons or delays in the game.
Hint: possible way to use delay:
public void pause(int milliseconds){
try{
Thread.sleep(milliseconds);
}catch(InterruptedException ex){
Thread.currentThread().interrupt();
}
}
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