Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using java create a version of the card game Hockey based off the below diagram: Below are the rules of the game: Players and Cards:

Using java create a version of the card game Hockey based off the below diagram:

image text in transcribed

Below are the rules of the game:

Players and Cards: Hockey is a game for two players only, using a standard 52-card deck with no jokers.

Deal: Four deals of 5 cards each and one of 6 cards each - is known as a "period". After a period is over, the next period begins and players switch as dealers. Three periods constitute a complete game.

Play: The players pick up the cards they are dealt, look at them, and play in turn. A turn consists of playing one card from your hand face up and the cards played by both players are stacked in a single pile so that only the most recently played card is visible. If a card is played which matches the rank of the top card of the pile (for example an 8 is played on an 8), this creates a breakaway for the person who played the matching card. Also, any time that a Jack is played, this creates a breakaway for the player of the Jack. If a player who creates a breakaway then matches the next card played by the opponent, the player scores a goal.

Examples: Player A plays a 7, player B plays a 7 (breakaway for B), player A plays a 4, player B plays a 4 (goal for B).

Player A plays a 7, B plays a 7 (breakaway for B), A plays a 4, B plays a 5 (breakaway lost), A plays a 9, B plays a 9 (breakaway for B - not a goal), A plays a Jack (breakaway for A), B plays an 8, A plays an 8 (goal for A).

Wining The Game: Going through all the cards in the deck is considered a period, at the end of three periods the player with more goals is the winner otherwise the game is a tie.

Game > Displayer Gamelnformation all game information goes here 1 +displayAll(Gamelnformation) +GivePlayerHand(Hand) +startGame0 +play0 +endGame0 +all getters and setters ext DisplayerGUI +displayAll(gamelnformation Player Deck -Integer score = 0 Boolean turn false Boolean winner = false DisplayerText +shuffle) +createHands0) +getNextHand0:Hand +displayAll(Gamelnformation +acceptHand(Hand) +takeTurn) abstract) 52 Card Hand Human AI 5..6 String suit String value +takeTun) +getNextCard0 Card +addNewCard(Card) emoveCard(Card) +takeTurn() +getCardlmageName0:String Game > Displayer Gamelnformation all game information goes here 1 +displayAll(Gamelnformation) +GivePlayerHand(Hand) +startGame0 +play0 +endGame0 +all getters and setters ext DisplayerGUI +displayAll(gamelnformation Player Deck -Integer score = 0 Boolean turn false Boolean winner = false DisplayerText +shuffle) +createHands0) +getNextHand0:Hand +displayAll(Gamelnformation +acceptHand(Hand) +takeTurn) abstract) 52 Card Hand Human AI 5..6 String suit String value +takeTun) +getNextCard0 Card +addNewCard(Card) emoveCard(Card) +takeTurn() +getCardlmageName0:String

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions