Skip to content

Instantly share code, notes, and snippets.

@koozdra
Last active November 12, 2017 03:47
Show Gist options
  • Save koozdra/4d3335c33a6be78e7979c0b3247162e2 to your computer and use it in GitHub Desktop.
Save koozdra/4d3335c33a6be78e7979c0b3247162e2 to your computer and use it in GitHub Desktop.
dice triplets
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