Created
August 9, 2019 02:55
-
-
Save Rhoxio/e04dc0022f32f2f84cb07e712429a80e to your computer and use it in GitHub Desktop.
thing.rb
This file contains hidden or 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
hash = { | |
a: 1, | |
b: 2, | |
c: 3 | |
} | |
hash[:a] # => 1 | |
hash[:b] # => 2 | |
def deal_deck(players = ['barry', 'josephine']) | |
hands = {} | |
players.each do |player| | |
if !hands.key?(player) | |
hands[player] << [deck.deal] | |
elsif hands.key?(player) | |
hands[player] << deck.deal | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment