Search:

Type: Posts; User: jadeclan

Search: Search took 0.08 seconds.

  1. Re: Trying to create an array of stacks that contain objects

    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.......
  2. Re: Trying to create an array of stacks that contain objects

    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...
  3. Re: Trying to create an array of stacks that contain objects

    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...
  4. Re: Trying to create an array of stacks that contain objects

    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...
  5. Re: Trying to create an array of stacks that contain objects

    I did post the complete error message.... I will have a look at the theory stuff, to see if I can deciper it.
  6. Re: Trying to create an array of stacks that contain objects

    Sorry about that. Used tags, you're right it is a lot easier to read.
  7. Re: Trying to create an array of stacks that contain objects

    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];
    ...
  8. Trying to create an array of stacks that contain objects

    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()...
Results 1 to 8 of 8