The first picture is the requirement for the following code. I have written most
ID: 3757005 • Letter: T
Question
The first picture is the requirement for the following code. I have written most of the code, but there are some red lines. Can you help me to fix them, and write the test document for these?
sE 1 16 Fall 018 f18scmrx G1Eclips github EX *Solitaire and Spider Solit @Course Information CSE × y) Course Proct Phase #1 x eCan YuHelp Me To FTX + https://cse.buffalo.edu/~mhertz/courses/cse1 16/Projects/project01.html [ Adding a Card Once the initial setup is complete, cards cannot be added to the stock pile Little Spider In Little Spider, an Ace is the LOWEST valued card in each suit. 8 Tableau Piles Initial setup Removing a Card Adding a Card After setting up the homecell piles, each tableau piles should be dealt 6 cards. Only the card which is currently at the top of the tableau pile can be removed. Once a card is removed, the card following it in the pile becomes the top card and can be removed. A card can be added to a tableau pile when its rank is either one below or one above than the tableau's top card. The cards' suits do not matter. When adding a card to a tableau pile, ranks can "wrap around. For example, a King (of any suit) can be added to a tableau pile if the tableau pile's current top card has a rank of either Queen or Ace. An Ace (of any suit) can be added to a tableau pile if the tableau pile's current top card has a rank of either King or 2 4 Homecell Piles Initial setup When the game begins, 1 homecell pile should have the Ace of Diamonds, another homecell pile should have the Ace of Hearts, a third homcell pile should have the King of Clubs, and the last homecell pile should have the King of Spades. Removing a Card Only the card which is currently at the top of the homecell pile can be removed. You cannot remove the last card in the homecell pile. Once a card is removed, the card following it in the pile becomes the top card and can be removed. Adding a Card A card whose suit is Hearts or Diamonds can be added to a homecell pile if it has the identical suit as the top card AND a rank one ABOVE the homecell pile's top card. For example, the Queen of Diamonds can only be added to a homecell pile whose current top card is the Jack of Diamonds. A card whose suit is Clubs or Spades can be added to a homecell pile if it has the identical suit as the top card AND a rank one BELOW the homecell pile's top card. For example, the Queen of Spades can only be added to a homecell pile whose current top card is the King of Spades. No matter its suit, the added card becomes the homecell's new top card. 0 Stock Piles Little Spider does not have a stock pile. 165:34 2018/9/29Explanation / Answer
Hi Sir, please find my comments for the errors in java files:-
1. class littleSpiderValue:- First create a map called cardRankings, like this, also import the necessary things
public class littleSpiderValue{
Map<String, Integer> cardRankings = new HashMap<String, Integer>();
......... // rest of code goes here
}
2. class littleSpiderSetup - In your Deck.java class, you dont have any static get() method that ur trying to access Deck.get(deckCounter). Either create a static method in Deck.java class or check in Deck class what getter method returns the value that you wanna fetch and insert into the List.
3. class littleSpiderAddCard = tableauPiles variable (which is supposed to be of type ArrayList<Card> is undefined, and the same you are trying to interate inside for each loop. Check the list variable properly or you need to declare tableauPiles variable in order to refer inside for each loop
4. class littleSpiderRemove = tableauPiles variable (which is supposed to be of type ArrayList<Card> is undefined, and the same you are trying to interate inside for each loop. Check the list variable properly or you need to declare tableauPiles variable in order to refer inside for each loop.
Pleae let me know in case of any clarifications required. Thanks!
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.