Skip to content

Instantly share code, notes, and snippets.

@andy318
Created May 7, 2011 01:57
Show Gist options
  • Save andy318/960125 to your computer and use it in GitHub Desktop.
Save andy318/960125 to your computer and use it in GitHub Desktop.
Create a deck of cards and return 13 of them at random
cards = [*'2'..'10', 'J', 'Q', 'K', 'A']
suits = ['C', 'D', 'H', 'S']
deck = cards.product(suits).map(&:join)
hand = deck.shuffle.each_slice(13).first
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment