Skip to content

Instantly share code, notes, and snippets.

@chadjemmett
Last active January 2, 2016 04:39
Show Gist options
  • Save chadjemmett/8251607 to your computer and use it in GitHub Desktop.
Save chadjemmett/8251607 to your computer and use it in GitHub Desktop.
Making a card deck.
def new_deck
all_cards = {}
[:hearts, :diamonds, :clubs, :spades].each {|suit| all_cards[suit] = (1..13).to_a.shuffle!}
return all_cards
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment