Danger: Infinite Loops?


#1


I cannot figure this one out guys. Just need help setting up the right code to end the infinite loop with a "while" but cannot seem to figure it out. Help please.


(ruby):6: syntax error, unexpected $end, expecting keyword_end

(ruby):6: syntax error, unexpected $end


i = 0
while i < 5
  puts i
  counter=i
puts while
  while i= i + 5
  end


#2

just try this code :smile:
i = 0
while i < 5
puts i
counter=i
puts i
i= i + 5
end


#3

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