Skip to content

Instantly share code, notes, and snippets.

@MarcoWorms
Created April 5, 2018 06:17
Show Gist options
  • Save MarcoWorms/71d26db8f851c66c6b25863d97d5eb01 to your computer and use it in GitHub Desktop.
Save MarcoWorms/71d26db8f851c66c6b25863d97d5eb01 to your computer and use it in GitHub Desktop.
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