Last active
November 12, 2017 03:47
-
-
Save koozdra/4d3335c33a6be78e7979c0b3247162e2 to your computer and use it in GitHub Desktop.
dice triplets
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 diceTriplets = sides => | |
_(sides) | |
.range() | |
.flatMap(a => | |
_(sides) | |
.range() | |
.flatMap(b => | |
_(sides) | |
.range() | |
.map(c => [a + 1, b + 1, c + 1]) | |
.value() | |
) | |
.value() | |
) | |
.value(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment