|
-
Sep 24th, 2007, 07:37 AM
#1
Thread Starter
New Member
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|