◆ 语句块:
使用“ do … end ”的形式就声明了一个语句(代码)块,里面可以包含任意多条语句。
do
local x = 10
print ( "x =", x)
end
◆ 条件语句:
if conditions then
...
elseif conditions then
...
else
...
end
◆ 循环语句:
- while循环语句
while conditions do
...
end
- repeat-util循环语句:当条件成立时退出循环
repeat
...
util conditions
- for循环语句:
for var=m,n,step do
...
end