Why is it displaying this error message ? (ruby):18: warning: integer literal in conditional range


#1

movies = {
‘fddfsd’ => 2,
‘dcdscsd’ => 3,
“b”=>5
}
puts"add/display/update/movie! "
choice = gets.chomp
case choice
when "add"
puts "enter the name of the movie"
title=gets.chomp
while movies[title]!=nil
puts"the movie is already in the list, enter a new movie"
title=gets.chomp
break if movies[title]==nil
end
rating = 7
while rating!= 1…4
puts "rate it"
rating=gets.chomp.to_i
case rating
when 1…4
puts "rated"
else
puts "error it has to be comprised between 1 and 4"
end
end
movies[title]= rating
when "update"
puts "Updated!"
when "dispaly"
puts "Movies!"
when"delete"
puts"Deleted!"
else
puts"Error!"
end


#2

It would be helpful (at least for me) if you could post your whole code. You should have some more code right?


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.