a,b,c=0,1,2
print(a,b,c)
print("local:")
x = 10
a = 3
if a<=1 then
local x = x*10
print(x)
elseif a<=3 then
local x = x*20
print(x)
else
local x = x*30
print(x)
end
print(x)
print("while:")
a = 1
while a<3 do
print(a)
a = a+1
end
print("repeat:")
i = 0
repeat
print("repeat:"..i)
i = i+1
until i>=3
print("for:")
for i=1,10,1 do
if(i==5)then
break;
end
print(i)
end
0 1 2
local:
200
10
while:
1
2
repeat:
repeat:0
repeat:1
repeat:2
for:
1
2
3
4
for i=10,1,-2 do
print(i)
end
10
8
6
4
2
repeat
x = 1
repeat
print(x)
x = x+1
until x >= 10
1
2
3
4
5
6
7
8
9