![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Lua
Emperor_Dandy
烧锅炉
展开
-
Lua学习笔记
功能 代码 备注 打印 print(“hello world”) 单行注释 “–单行注释” 两个减号 多行注释 “–[[多行注释]]–” 全局变量 x = 1 所有变量如果没有初始化,则默认全局nil 局部变量 local x = 1 若不进行初始化认为nil 获取指定变量的类型 type(val) nil、boole原创 2016-12-23 16:44:29 · 1782 阅读 · 0 评论 -
lua 获取某个数精确到小数点后n位的结果
x = math.pi -- 3.14 print( x - x % 0.01 )原创 2017-12-04 16:23:05 · 2926 阅读 · 0 评论