Last active
May 11, 2017 14:45
-
-
Save joeegan/87f56fafaf1ef77893b08539147b8c6c to your computer and use it in GitHub Desktop.
point free grid (missing shuffle)
This file contains hidden or 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 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