Skip to content

Instantly share code, notes, and snippets.

@obedeugene
Created May 29, 2014 01:06
Show Gist options
  • Save obedeugene/da7d64fabe69b338a0e3 to your computer and use it in GitHub Desktop.
Save obedeugene/da7d64fabe69b338a0e3 to your computer and use it in GitHub Desktop.
Deck of cards
def deck
suits = ['hearts', 'clubs', 'spades', 'diamonds']
cards = [*2..10, 'Jack', 'Queen', 'King', 'Ace']
suits.each do |suit|
cards.each do |card|
puts "#{card} of #{suit}"
end
end
end
def deal
deck.shuffle
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment