5. Loops & Iterators, Ruby


#1



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
end


#2

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


#3

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.


#4

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


#5

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

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

EDIT:

oops, thought you were tekkie, hah...


#6

well thanks im done now:unicorn:


#7

you explained it better than tekke.


#8

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