• Programming & Tech Projects
  • October 25, 2023
  • 388 Views

JAVA GAME PROGRAMMING

  • Freelancer Type
  • Project Duration
  • Level Top Expert

Description


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.

Comments from Customer

This task should be completed with well-commented code. Please comment all methods and functions.

Skills Required

Programming & Technology

Project ID:FS-11022-kazi

Project Proposals (1)

Maureen Chepkirui
  • 1 year ago
  • 5.0 ( 1 review )
  • Ksh2,500.00
  • in 2 days

I can handle the work perfectly

Send Your Proposal

Ksh
Days
  • Estimated Total Cost

    The total project cost.

    Ksh2,500.00

  • Service Fee (2%)

    The service fee that will be deducted from your proposed amount.

  • Your Earning

    Total amount you will earn.

  • Stick this Proposal to the Top

    The sticky proposal will always be displayed on top of all the proposals.

  • Ksh12.00
  • Make Sealed Proposal

    The sealed proposal will be sent to the project author only it will not be visible publically.

  • Ksh7.00
  • Featured Proposal

    The featured proposal will have a distinctive color and popped up between other proposals to get the author's attention.

  • Ksh5.00
I agree to the terms and conditions
Budget
Ksh2,500.00
Fixed

551 Days left

Exemplary Writer

Member since October 24, 2023
View Profile

About The Employer

  • 0 Projects completed
  • Payment Method
  • Email Verified

Open Jobs

More from Exemplary Writer

Report Project