KillerDesigner
10/6/2013 - 1:50 AM

hashing_prac.rb


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