Skip to content

Instantly share code, notes, and snippets.

@DonSchado
Created June 29, 2012 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DonSchado/3019358 to your computer and use it in GitHub Desktop.
Save DonSchado/3019358 to your computer and use it in GitHub Desktop.
A deck of cards in ruby
suits = %w{s h d c}
ranks = %w{2 3 4 5 6 7 8 9 T J Q K A}
deck = suits.product(ranks)
def pull_card
deck.sample
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment