I'm writing some JavaScript that will eventually display a tarot spread. Right now, I'm having trouble with a two dimensional array of cards, two dimensions because I need to keep track of the orientation of the cards.
Part of the file so far:
const DeckSize = "78";
function TarotCard(cardNumber, isInverse){
card=new Array();
card.push(cardNumber);
card.push(isInverse);
console.log("new card="+card[0]+" "+card[1]);
}
function TarotDeck(){
deck=new Array();
for(i=0; i<DeckSize; i++){
deck.push(new TarotCard(i, false));
console.log("pushed new card as "+deck[i][0]+" and "+deck[i][1]);
}
console.log(deck.length);
return shuffleDeck(deck, 3);
}
The console.log lines give this:
new card=0 false pushed as undefined and undefined
...78 times, of course. I'm not sure where things are going wrong.