Created
September 24, 2013 22:12
-
-
Save OfTheDelmer/6692031 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
my_hash = {"jackie"=>"I like bowling", "Luke"=>"likes riding his bike", "imogen"=>"I have a cold", "sara"=>"I ride bart"} | |
puts "Want to start a hash?" | |
response = gets.chomp | |
while response == "y" | |
puts "Give us your name" | |
key = gets.chomp | |
puts "Tell us something about you" | |
val = gets.chomp | |
my_hash[key] = val | |
puts "Continue?" | |
response = gets.chomp | |
end | |
my_hash.each do |key, val| | |
print "#{key}\t#{val}\n" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment