Created
January 21, 2014 18:26
-
-
Save wand125/8545387 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cards = [[1,2,3,4],[1,5,6,7],[1,8,9,10],[1,11,12,13],[2,5,8,11],[2,6,9,12],[2,7,10,13],[3,5,9,13],[3,6,10,11],[3,7,8,12],[4,5,10,12],[4,6,8,13],[4,7,9,11]] | |
num = [1..13].map((a) -> [a,Math.random()]).sort((a,b) -> a[1]-b[1]).map((a) -> a[0]) | |
cards[index] = card.map((a) -> num[a-1]).map((a) -> [a,Math.random()]).sort((a,b) -> a[1]-b[1]).map((a) -> a[0]) for card,index in cards | |
cards = cards.map((a) -> [a,Math.random()]).sort((a,b) -> a[1]-b[1]).map((a) -> a[0]) | |
console.log card for card in cards |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment