I'm in the early stages in learning Ruby and ran into an issue when trying to create a conditional statement for one of my programs. I basically wanted it to loop back and grab a fresh input value if the orignal didn't meet the criteria of the first two conditionals.
So for example:
puts "Choose either the 'red' or 'blue' pill"
choice = gets.to_s.downcase.chomp
if choice == red
puts "Fasten your seatbelt dorothy 'cause kansas is going bye-bye"
elsif choice == "blue"
puts "The story ends, you wake up in your bed and believe whatever you want to believe"
else
puts "You have to choose one"
end
reda variable? If not,choice == redwill fail. It's important your source code be runnable.