5. Loops & Iterators, Ruby


So i was trying to make it add one more each time to get it to reach ten and i cna't figure out how to fix this. Can someone tell me what I'm doing wrong here?

counter = 0
until counter >= 10
  puts counter
 i += 1


Why are you increment i and not counter? :stuck_out_tongue:


As tekkie said, you seem to be trying to increment the wrong variable, are 'i' and 'counter' the same?

If this helped, hit the checkmarked box at the bottom of the post, credit should go to tekkie though.


oh...I guess I did do that wrong...:disappointed_relieved:


Actually you did perfect, I just don't think he(she) understood. :wink:

Oh crap, didn't notice the solution went to me! Sorry!


oops, thought you were tekkie, hah...


well thanks im done now:unicorn:


you explained it better than tekke.


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