Browse Source

Fix card-sorting;

feature/split
Nero Ignis 5 years ago
parent
commit
3386e7f230
  1. 7
      js/CardDeck.js

7
js/CardDeck.js

@ -60,12 +60,7 @@ class CardDeck {
let cardCount = this.cards.length, t, i; let cardCount = this.cards.length, t, i;
for (let run = 0; run === runs; run++) { for (let run = 0; run === runs; run++) {
while (cardCount) { this.cards.sort( () => Math.random() - 0.5);
i = Math.floor(Math.random() * cardCount--);
t = this.cards[cardCount];
this.cards[cardCount] = this.cards[i];
this.cards[i] = t;
}
} }
} }

Loading…
Cancel
Save