Updated documentation and used push()

This commit is contained in:
christopher.millward
2022-01-04 10:44:48 -05:00
parent a05a1fedf3
commit fe6ff50d2f

View File

@@ -73,7 +73,7 @@ function createGameDeck(cards, gameSize) {
do {
card = Math.floor(deckSize * Math.random());
} while (deck.includes(card));
deck[j] = card
deck.push(card);
}
return deck;
}
@@ -129,7 +129,7 @@ async function main() {
let playerScore = 0;
// Generate a random deck
const gameSize = 4;
const gameSize = cards.length; // Number of cards to shuffle into the game deck. Can be <= cards.length.
const deck = createGameDeck(cards, gameSize);
let shouldContinuePlaying = true;