Skip to content

Instantly share code, notes, and snippets.

@radar
Created November 26, 2018 23:08
Show Gist options
  • Save radar/d06939eccc3d3088b3c1ab5e74b15a68 to your computer and use it in GitHub Desktop.
Save radar/d06939eccc3d3088b3c1ab5e74b15a68 to your computer and use it in GitHub Desktop.
suits = %w(Clubs Spades Diamonds Hearts)
numbers = %w(Ace Two Three Four Five Six Seven Eight Nine Ten Jack Queen King)
cards = suits.flat_map do |suit|
numbers.map do |num|
"#{num} of #{suit}"
end
end
cards.sample
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment