var deck = ["DJ", "DJ", "S10", "S10", "SQ", "SQ", "SK", "SK", "CQ", "CQ"];
function shuffle(array) {
var currentIndex = array.length, temporaryValue, randomIndex;
while (0 !== currentIndex) {
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex -= 1;
temporaryValue = array[currentIndex];
array[currentIndex] = array[randomIndex];
array[randomIndex] = temporaryValue;
}
return array;
}
var deck = ["DJ", "DJ", "S10", "S10", "SQ", "SQ", "SK", "SK", "CQ", "CQ"];
function makeRandomArr(a, b) {
return Math.random() - 0.5;
}
deck.sort(makeRandomArr);
function random(n) {
return Math.floor(Math.random() * Math.floor(n));
}
function shuffle (arr) {
for (var i = 0; i < arr.length; i++) {
var j = random(arr.length);
var k = random(arr.length);
var t = arr[j];
arr[j] = arr[k];
arr[k] = t;
}
return arr;
}
var deck = ["DJ", "DJ", "S10", "S10", "SQ", "SQ", "SK", "SK", "CQ", "CQ"];
deck = shuffle(deck);