Last active
December 29, 2016 00:11
-
-
Save gnomex/3f2760094c185bca4ff2935cc144f795 to your computer and use it in GitHub Desktop.
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
# first option | |
list = for n <- 1..60, do: n | |
list |> Enum.shuffle |> Enum.take(6) | |
# second option (using same list defined before) | |
Enum.take_random(list, 6) | |
# third option | |
(for n <- 1..60, do: n) |> Enum.shuffle |> Enum.take(6) | |
# nested option | |
Enum.take_random((for n <- 1..60, do: n), 6) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment