I’m terribly new to Ruby, and I just can’t figure out what I’m doing
wrong with my code. I’ve been staring at it for 15 minustes now, without
coming to any conclusion.
What I want the code to do ask for the reader’s name. And if the reader
fills in anything blank. It will ask the same question again
loop do
puts “You’re starting to remember your name. What is it?”
name = gets.chomp.upcase
break if name != “”
end
puts “Yeah, that’s right! Your name is #{name}.”
gets
The looping works perfectly fine, but if the user-input is anything else
than “”, the program stops.