lua中false和nil均为false,true和非nil均为true
if condition then
statements
end
a=20
if a>10 then
print(a)
end
20
a<10
if condition then
statements
else
statements
end
a=10
if a>9 then
print("a > 9")
else
print("a < 9")
end
a > 9
if condition then
statements
elseif condition then
statements
else
statements
end
a=5
if a>5 then
print("a>5")
elseif a>3 then
print("a>3")
else
print("else statements")
end
a>3