diff --git a/js/CardDeck.js b/js/CardDeck.js index fd95a3b..cb00e02 100644 --- a/js/CardDeck.js +++ b/js/CardDeck.js @@ -60,12 +60,7 @@ class CardDeck { let cardCount = this.cards.length, t, i; for (let run = 0; run === runs; run++) { - while (cardCount) { - i = Math.floor(Math.random() * cardCount--); - t = this.cards[cardCount]; - this.cards[cardCount] = this.cards[i]; - this.cards[i] = t; - } + this.cards.sort( () => Math.random() - 0.5); } }