lua常用
来源:互联网 发布:淘宝图片软件 编辑:程序博客网 时间:2024/06/06 04:57
1.技巧
1.条件运算结果
- 关键字:
and
or
- 结果:条件运算结果是
值
例子
local aa = true and 2 or 5local bb = nil and truelocal cc = true and 100print(aa) --打印:2print(bb) --打印:nilprint(cc) --打印:100
2.实现C++的 :?
运算符
--公式:条件 and 值1 or 值2local aa = true and 2 or 5 --aa 等于2--A 或 B只有有一个是假(false、nil),val的值就是Clocal val = A and B or C
阅读全文
0 0
- Lua 常用
- lua常用
- Lua常用
- lua 常用的用法
- lua常用函数
- Lua 常用函数 一
- Lua常用函数
- lua 常用网址
- LUA常用函数
- Lua常用函数
- lua table常用函数
- Lua 常用函数 一
- Lua 常用方法
- lua 常用语法
- lua常用函数
- Lua常用Math函数
- Lua 常用库
- Lua 常用库函数
- PO类注解配置和PO类映射文件配置关系
- Codeforces 508E Arthur and Brackets【贪心】
- forEach和map和for方法的区别
- 3.spring boot自定义配置
- eclipse springcloud服务发现服务注册(Eureka) 学习日志
- lua常用
- Stirling数
- 回调函数和函数指针
- 机器学习十大算法
- 您想找一份与DevOps有关的工作吗
- 将一个php 程序 添加到linux开机自动启动
- hibernate中sequence主键生成策略
- Win10下安装TensorFlow
- Original error: Could not get the iOS SDK version because the Xcode version could not be determined