Skip to content

Instantly share code, notes, and snippets.

@domgetter
Created July 7, 2014 03:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save domgetter/adf10f488b225cd0b141 to your computer and use it in GitHub Desktop.
Save domgetter/adf10f488b225cd0b141 to your computer and use it in GitHub Desktop.
class Deck
RANKS = %w(2 3 4 5 6 7 8 9 10 J Q K A)
SUITS = %w(s h c d)
def initialize
@cards = []
RANKS.product(SUITS).each do |card|
@cards << {rank: card[0], suit: card[1]}
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment