Ruby Ruby Loops Ruby Loops Loop Conditionals

Yuichi Narisawa
Yuichi Narisawa
19,548 Points

Why this code doesn't work?

It looks so easy but I can't get the right answer. Please help me...

loop.rb
# Assume get_answer() is already defined

loop do
  if answer == get_answer
  break
 end

end

1 Answer

Maciej Czuchnowski
Maciej Czuchnowski
36,427 Points

Yuichi,

please watch the videos once again and make sure you understand how the loop works. Also, make sure you understand the difference between = and ==and note that the task also wants you to use variable named e. Try more variants and let me know here if you hit another bump on the road.

Yuichi Narisawa
Yuichi Narisawa
19,548 Points

Hi Maciej,

Thank you for your advice! I've missed the "variable e" part. I need to read the instruction more carefully!