I am trying to create a loop that will ask the user for an integer and will then print "hi" an integer number of times and then ask for input again. I then want the loop to break if the user inputs "bye".
my code so far:
number = gets
gets == "bye"
break if gets.chomp == "bye"
This is so because your input would be something like
bye\n, so your condition always false, because
gets takes even the enter.