Created
November 12, 2023 11:21
-
-
Save micedreams/118e8f47bb854c61dc9ddaba03d0d8df to your computer and use it in GitHub Desktop.
hash
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
friendgame_hash = {} | |
input = "" | |
friend = "" | |
game = "" | |
puts "Enter name of friend, then their favorite game: or Press Enter to quit" | |
input = gets.chomp | |
while input != "" do | |
puts "Enter name of friend: " | |
friend = gets.chomp | |
puts "Enter friends favorite game: " | |
game = gets.chomp | |
friendgame_hash[friend] = game | |
input = gets.chomp | |
end | |
puts "Here is the content that was in the hash: " | |
friendgame_hash.each do |key, value| | |
puts " #{key} => #{value}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment