Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to check the infinite loop in C and LUA, can I use the FOR loop? How to use it? Thank you~
How to check the infinite loop in C and LUA, can I use the FOR loop? How to use it? Thank you~
-[[Lua's words, for has three parameters: starting value, ending value and step size.

For example:-]]

For i = 1,-1

Printing (1)

end

-No output.

For i = 1,-1,-1

Printing (1)

end

-& gt; 1

-& gt; 0

-& gt; - 1

- [[

Just making some supplements. Now answer the LZ infinite loop question:

If there is an infinite loop, it is generally recursive infinite loop and while infinite loop ... as for R, it is generally not used.

And Boolean expressions can

sentence

end

So as long as the Boolean expression is checked, it is likely to be false ...............................................................................................................................................................

Another kind, such as the function h() h() end, if you don't care about it, Lua will overflow.

According to the test time, that is

n=os.time()

Circular object ...

if OS . time()-n & gt; 30 and then the interrupt ends.

Circular object ...

- ]]