Skip to content

Instantly share code, notes, and snippets.

@gausby
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save gausby/9100301 to your computer and use it in GitHub Desktop.

Select an option

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.
(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
@gausby
Copy link
Author

gausby commented Feb 19, 2014

Output example: [{:card, :hearts, 6}, {:card, :clubs, 7}, {:card, :spades, 4}, {:card, :spades, 7}, {:card, :spades, 2}]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment