Created
May 17, 2014 03:32
-
-
Save anonymous/b78f98acb57f4540f79d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def new_deck | |
card_suits = [:clubs, :hearts, :diamonds, :spades] | |
card_values = (1..13).to_a | |
card_suits.product(card_values) | |
end | |
def deal_card(deck) | |
card_to_deal = deck.sample(1) | |
deck.delete(card_to_deal) | |
card_to_deal | |
end | |
my_deck = new_deck | |
my_first_card = deal_card(my_deck) | |
my_second_card = deal_card(my_deck) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment