Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The game contains 36 UNO Cards with Sesame Street Characters: (4) Big Bird #1 ca

ID: 3830008 • Letter: T

Question

The game contains 36 UNO Cards with Sesame Street Characters: (4) Big Bird #1 cards (red, yellow, blue, green) (4) Zoe #2 cards (red, yellow, blue, green) (4) Cookie Monster #3 cards (red, yellow, blue, green) (4) Elmo #4 cards (red, yellow, blue, green) (4) Baby Bear #5 cards (red, yellow, blue, green) (4) Rosita #6 cards (red, yellow, blue, green) (4) Grover #7 cards (red, yellow, blue, green) (2) Ernie and Bert "Draw 1" cards (red, blue) (2) Oscar the Grouch "Choose who to draw 2" cards (yellow, green) (4) Monster "Wild" cards Game Setup: 1. Shuffle the cards. 2. Each player draws a card. The player with the highest card number starts first. 3. Reshuffle all the cards and deal 5 cards to each player. 4. Place the remaining cards face down to make a Draw Pile. 5. Turn over the top card of the Draw Pile to make the Discard Pile. If the card drawn is a Wild Card or a Draw 2 Card, continue drawing cards until you find a number card (1-7). Game Play: The first player goes first. The player may play a card that matches the number, color or character of the card in the Discard Pile, or a special card (see below). If the player has a card that matches color, number or character, the player will put it in the Discard Pile. Example: If the card in the Discard Pile is a Blue Zoe #2 Card, the player may play any Blue Card or any Zoe #2 Card. If the player does not have a match or a Wild Card, the player must draw one card from the Draw Pile. If the card the player draws matches the color, number or character of the card in the Discard Pile, the player may put it play it. Otherwise, the player's turn ends.

Explanation / Answer

import java.util.ArrayList; import java.util.Collections; /** * An implementation of the game of Uno. * * @author Malcolm Ryan * @version 23 September 2011 */ public class UnoGame { private ArrayList myDeck; private ArrayList myPile; private ArrayList myPlayers; private int myCurrentPlayer; private int myPlayDirection; /** * Create a new game with a standard deck of cards * * @param nPlayers The number of players */ public UnoGame(int nPlayers) { myDeck = new ArrayList(); for (int c = 1; c
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote