Skip to content

Instantly share code, notes, and snippets.

@Rhoxio
Created August 9, 2019 02:55
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 Rhoxio/e04dc0022f32f2f84cb07e712429a80e to your computer and use it in GitHub Desktop.
Save Rhoxio/e04dc0022f32f2f84cb07e712429a80e to your computer and use it in GitHub Desktop.
thing.rb
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