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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!