Created
April 5, 2018 06:17
-
-
Save MarcoWorms/71d26db8f851c66c6b25863d97d5eb01 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
const { pipe, sortBy, prop, pluck } = require('ramda') | |
const shuffle = (seed, deck) => { | |
const routine = pipe( | |
deck => deck.map((card, index) => ({ | |
rank: seededRandom(seed + index), | |
card, | |
})), | |
sortBy(prop('rank')), | |
pluck('card') | |
) | |
return routine(deck) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment