Last active
August 29, 2015 13:56
-
-
Save gausby/9100301 to your computer and use it in GitHub Desktop.
The fact that I didn't have to consult any manual, or notes, to write this makes me even more excited about Elixir.
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
| (lc suit inlist [:hearts, :spades, :diamonds, :clubs], value inlist [1,2,3,4,5,6,7,8,9,:j,:q,:k,:a], do: {:card, suit, value}) |> Enum.shuffle |> Enum.take 5 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output example:
[{:card, :hearts, 6}, {:card, :clubs, 7}, {:card, :spades, 4}, {:card, :spades, 7}, {:card, :spades, 2}]