Skip to content

Instantly share code, notes, and snippets.

@joeegan
Last active May 11, 2017 14:45
Show Gist options
  • Select an option

  • Save joeegan/87f56fafaf1ef77893b08539147b8c6c to your computer and use it in GitHub Desktop.

Select an option

Save joeegan/87f56fafaf1ef77893b08539147b8c6c to your computer and use it in GitHub Desktop.
point free grid (missing shuffle)
const fill = curry((thing, start, end, data) => Array.prototype.fill.call(data, thing, start, end));
const shuffle = curry(data => data);
const chunk = curry(function group(n, list) {
return R.isEmpty(list) ? [] : R.prepend(R.take(n, list), group(n, R.drop(n, list)));
});
pipe(
fill(0, 9, 71),
fill(1, 0, 9),
shuffle,
chunk(9)
)(Array(81))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment