Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Only complete the DO THIS methods thank u! Game Instructions The objective of UNO is to be the first player to get rid of all

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Only complete the DO THIS methods thank u!

Game Instructions The objective of UNO is to be the first player to get rid of all your cards. A deck with 80 cards, each card containing a number and a color is used. Colors are RED, YELLOW, GREEN, and BLUE, numbers are integers from 0 to 9. The deck is initially shuffled, 7 cards are given to each player, and one card is placed on a "game" pile (initially it only has only one card). Players take turns, starting with the human player. On your turn you must match a card from your hand (human deck) to the card on top (front) of the game pile either by number or color. If you have such a card, you must click on it to throw it on top of the game pile. This card now becomes the card that your opponent will try to match. EXAMPLE: If the card on the game pile is red 7 (7R), you must throw a red card OR a card of any color with a number 7. If the player does not have a matching card, the player must take a card from the deck by clicking on the deck button. You must keep taking cards until you get a card that matches. If at some point you have more than 7 cards on your "hand then you can use the left/right arrows ("") to see your other cards (you can only see 7 cards at a time). If the "deck is almost depleted, the "game" pile will be reshuffled and added to the "deck so that the game can continue (this is done automatically when the deck has 5 cards or less). The game ends once a player has no cards. The player with no cards wins. public class CardList { /* Attributes: first, keeps the front of the list * count, keeps track of the number of Cards on the list */ private Card first; private int count; public int size() { return count; } o public Card getFirst() { return this.first; } /* * Constructor (I did this one for you) * if all is true, it creates a complete deck of 40 cards, * 4 colors, numbers from 0-9 * if all is false, it just creates an empty list */ public CardList(boolean all) { first=null; count=0; if (all) { for (Card.Colors color : Card.Colors.values()) { for (int number=0; number") to see your other cards (you can only see 7 cards at a time). If the "deck is almost depleted, the "game" pile will be reshuffled and added to the "deck so that the game can continue (this is done automatically when the deck has 5 cards or less). The game ends once a player has no cards. The player with no cards wins. public class CardList { /* Attributes: first, keeps the front of the list * count, keeps track of the number of Cards on the list */ private Card first; private int count; public int size() { return count; } o public Card getFirst() { return this.first; } /* * Constructor (I did this one for you) * if all is true, it creates a complete deck of 40 cards, * 4 colors, numbers from 0-9 * if all is false, it just creates an empty list */ public CardList(boolean all) { first=null; count=0; if (all) { for (Card.Colors color : Card.Colors.values()) { for (int number=0; number

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

Step: 3

blur-text-image

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

Marketing Audit Checklists A Guide To Effective Marketing Resource Realization

Authors: Aubrey Wilson

1st Edition

0077077601, 978-0077077600

More Books

Students also viewed these Accounting questions