Looping with 'While'


#1

So I have this code:

i = 1
while i > 51 do
  print i
  i=i+1

But it just says

nil


in the console.


\`\`\` not working sometimes
\`\`\` not working sometimes
#2

Two problems:

  1. You are probably missing the end keyword.
  2. Your while condition isn't perfect.

#3

@gaurangtandon

I see what you mean.


#4

@gaurangtandon
I tried your solution. I actually had the end keyword, but the condition was wrong. When I changed it, the code worked.