for正常循环
for i=1,10 do
print(i)
end
for步长2循环
for i=1,10,2 do
print(i)
end
while反向循环
i=10
while i>0 do
i=i-1
print(i)
end
while正常循环
i=0
while i<10 do
i=i+1
print(i)
end
测试地址:
http://www.runoob.com/try/runcode.php?filename=datatype1&type=lua
网友评论