-
Linked lists
Hi guys,
I'm working on a Java-application, but really don't know where to start, and was hoping someone can help me out. This is the exercise:
Write a class PlayCards which includes a redirection to a linked list with a set of gamecards.
The constructor method of PlayCards generates, when initializing the application, a sorted stack of gamecards.
Write a method to print the color and value of each card.
Write a method to shuffle the game. Do this by splitting the the stack at a sudden point, and switch the first half with the second half. Repeat this several times.
And this is as far as I can get:
Public class Playcard{
private String color;
private String value;
private Speelkaart nextcard;
Playcard(String color, String value)
{
this.color=red;
this.value= hearts;
}
public String getColor (){
return color();
}
public String getvalue(){
return value();
}
}
Anyone wants to help out?
-
Re: Linked lists
1- I'm sure a card's value is the number written on it (int).
2- You have no linked list in here. read about Linked lists before you dig into coding.
3- As a hint use array of 52 cards (numbers) and use the number to initialize a card (every suit is 13 cards)