Created
November 7, 2018 23:12
-
-
Save quii/2916b728274e6703fbbe7b3465204cbf 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
address_book = { | |
"Chris" => "chris@james.com", | |
"Ruth" => "ruth@baker.com", | |
"Pepper" => "pepper@pot.com" | |
} | |
givers = address_book.keys.shuffle | |
receivers = givers.rotate(1) | |
givers_receivers = givers.zip(receivers) | |
givers_receivers.each do |giver,receiver| | |
giver_email = address_book[giver] | |
puts "#{giver} <#{giver_email}> gives to #{receiver}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment