Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

check my java code: package unoquattro; import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; /** * @author liz_pfeifer */ public class QuattroGame{ private ArrayList cardListStack; //draw pile

check my java code: package unoquattro; import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; /** * @author liz_pfeifer */ public class QuattroGame{ private ArrayList cardListStack; //draw pile private ArrayList cardListDiscard; //discard pile private ArrayList playerList; //list of players // private int NUMBER_OF_PLAYERS = 4; // private int STARTING_CARD_NUMBER = 3; // private int cardCodeSeed = 0; public QuattroGame () { cardListStack = new ArrayList<>(); cardListDiscard = new ArrayList <>(); playerList = new ArrayList<>(); } public void createCards() { //create cards for play // Add 10 red cards for (int i = 0; i <= 9; i++) { cardListStack.add(new StandardColourCard("R" +i, "Red", i)); } // Add 10 blue cards for (int i = 0; i <= 9; i++) { cardListStack.add(new StandardColourCard("B" +i, "Blue", i)); } // Add 10 yellow cards for (int i = 0; i <= 9; i++) { cardListStack.add(new StandardColourCard("Y" +i, "Yellow", i)); } // Add 10 green cards for (int i = 0; i <= 9; i++) { cardListStack.add(new StandardColourCard("G" +i, "Green", i)); } // shuffle draw pille Collections.shuffle (cardListStack); } //create players in the game public void createPlayers() { //add human player Scanner scanner = new Scanner(System.in); System.out.print("Enter human player's name: "); String name = scanner.nextLine(); playerList.add(new Player(name, true))

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

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions