if...elseif....else...end,这是lua中的条件判断语句。

-- if (条件)  then
--   ...
-- elseif (条件)  then
--   ...
-- else
--   ...
-- end


n = 10
if (n==1)  then
    print (1)
elseif (n==5) then
    print (5)

else
    print ('hehe')
end
>>
hehe

 

posted on 2018-11-12 09:47  望月又一  阅读(1897)  评论(0编辑  收藏  举报