Quote (carteblanche @ Dec 7 2015 12:17am)
at this moment, c is a local variable that you're not using. no matter what you assign to it, c will go out of scope once the method ends.
if you want cards[0] to contain c, then you need to do so:
cards[0] = c;
notice the difference?
That does make sense, thank you. Sadly that didn't fix my error. Maybe it is within my draw method?
Code
public Card draw() {
if(numCardsInDeck > 0){
numCardsInDeck--;
Card r = cards[numCardsInDeck];
return r;
}
else{
System.out.println("Error.");
return null;
}
}
I saw a note on my group website that I should be removing the card from the deck too, not just decrementing numCardsInDeck.
edit: this is whenever you draw the card from the top of the list [52..51?]
This post was edited by vunel on Dec 6 2015 10:26pm