Skip to content

Instantly share code, notes, and snippets.

@luckyruby
Created March 23, 2020 20:59
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 luckyruby/84aadbe5dfb576c8ef4fb4c0fe7623da to your computer and use it in GitHub Desktop.
Save luckyruby/84aadbe5dfb576c8ef4fb4c0fe7623da to your computer and use it in GitHub Desktop.
def generate_cards
@cards = []
FACES.each do |face|
SUITS.each do |suit|
@cards << Card.new(face,suit)
end
end
end
def generate_cards
@cards = FACES.map do |face|
SUITS.map do |suit|
Card.new(face,suit)
end
end
@cards.flatten!
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment