Skip to content

Instantly share code, notes, and snippets.

@slawrence
Created December 13, 2012 15:48
Show Gist options
  • Save slawrence/4277314 to your computer and use it in GitHub Desktop.
Save slawrence/4277314 to your computer and use it in GitHub Desktop.
document.getElementById('results').innerHTML = (function (suits, ranks) {
var cards = [], i, j;
for (i = 0; i < suits.length; i += 1) {
for (j = 0; j < ranks.length; j += 1) {
cards.push(suits[i] + ranks[j]);
}
}
return cards;
}(['S', 'H', 'C', 'D'], [ '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K', 'A']))
.sort(function (a, b) {
return Math.random() - .5;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment