Lua script notes – (1) – control statement if

Time:2020-9-29
-- 1. if end
a=1
if a==1 then 
  print(a)
end

-- 2. if else end
b=1
if b < 10 then
  print('b<10 and b='..b)
else
  print('b>10 and b='..b)
end

-- 3. if elseif else end
score=64
if score>=0 and score<60 then
  Print ('fail, score '.. score)
elseif score>=60 and score<80 then
  Print ('average score '... Score)
elseif score>=80 and score<=100 then
  Print ('good grades, score '.. score)
else 
  Print ('wrong score! Score '... Score)
end

Recommended Today

What black technology does the real-time big data platform use behind the glory of the king?

Hello everyone, I’m Xu Zhenwen. Today’s topic is “Tencent game big data service application practice based on Flink + servicemesh”, which is mainly divided into the following four parts: Introduction to background and Solution Framework Real time big data computing onedata Data interface service onefun Microservice & servicemesh 1、 Introduction to the solution framework and […]