环境搭建:下载LuaForWindows

 

每行代码都可称作为一个“程序块”

Lua语句之间不需要分隔符。使用空格即可,当然换行 和“;”也可以。

--style 1
a=1 b=a*2

--style 2
a=1;b=a*2;

--style 3
a=1
b=a*2   --分号可有可无

dofile() --加载程序库

Lua标识符不能以数字开头,并且要避免使用以一个下划线开头并跟着一个或多个大写字母的标识符。

在Lua中字母不仅仅是英文字母,与区域设置相关。

Lua保留字:  

  and  break  do  else  elseif  end  false  

  for  function  if  in   local  nil  not

  or  repeat  return  then  true  until  while

Lua大小写敏感。所以And与and不同,And不是保留字

Lua注释有两种:--行注释 ; --[[到]]为块注释。重启这段代码需要在行首添加一个连字符即可  

相关文章:

  • 2021-10-23
  • 2022-12-23
  • 2021-09-03
  • 2021-08-09
  • 2021-11-12
  • 2021-07-03
  • 2022-02-04
  • 2021-06-29
猜你喜欢
  • 2021-07-04
  • 2021-05-25
  • 2021-06-11
  • 2022-02-22
  • 2022-02-11
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案