Fishing for an aha moment (for me) in your last response, I tried changing the offending line to:
piles.get(i).push(currentDeck.dealSingleCard());
and
tada no error
you are a genius.......
Type: Posts; User: jadeclan
Fishing for an aha moment (for me) in your last response, I tried changing the offending line to:
piles.get(i).push(currentDeck.dealSingleCard());
and
tada no error
you are a genius.......
the error says
unexpected type
expected: variable found: value
The error occurs on the line:
piles.get(i) = (Stack) piles.get(i).push(currentDeck.dealSingleCard());
which is second to...
I actually tried that in my attempts (see below)
and got an unexpected type in the body of the last for loop. (error message was: unexpected type required variable, found value)
I also tried...
I read the theory and think I grasp what's been said, but I'm still left with the question: Do I need to create 17 stacks of different names rather than use an array/ arraylist/ list / other???? If I...
I did post the complete error message.... I will have a look at the theory stuff, to see if I can deciper it.
Sorry about that. Used tags, you're right it is a lot easier to read.
I have taken your advice and gone back to where I started, this is what I have:
public class Solitaire_Engine
{
private Stack <Card> piles [] = new Stack <Card> [17];
...
I have tried so many things, I am now thorougly confussed. I am trying to make an array of Stacks that will contain objects called Card. I need 17 stacks of cards. The currentDeck.dealSingleCard()...