lua switch
来源:互联网 发布:mac itunes 设置铃声 编辑:程序博客网 时间:2024/05/16 12:21
print "Hello, switch-case"
local switch = {
[1] = function() -- for case 1
print "Case 1."
end,
[2] = function() -- for case 2
print "Case 2."
end,
[3] = function() -- for case 3
print "Case 3."
end
}
local a = 4
local f = switch[a]
if(f) then
f()
else -- for case default
print "Case default."
end
local switch = {
[1] = function() -- for case 1
print "Case 1."
end,
[2] = function() -- for case 2
print "Case 2."
end,
[3] = function() -- for case 3
print "Case 3."
end
}
local a = 4
local f = switch[a]
if(f) then
f()
else -- for case default
print "Case default."
end
阅读全文
0 0
- lua switch
- Lua里的"switch-case"语句
- lua中利用table表模拟switch
- [Lua]实现switch的一种方案
- lua中实现switch以及sublime下自动补全switch语法
- lua中实现switch以及sublime下自动补全switch语法
- lua中实现switch以及sublime下自动补全switch语法
- switch
- Switch
- Switch
- switch
- switch
- switch
- Switch
- switch
- switch
- switch
- SWITCH
- Oracle12C--显式游标(三十六)
- jzoj P1522 无线网络
- Linux 快捷键
- 5、聚类之层次聚类、基于划分的聚类(k-means)、基于密度的聚类、基于模型的聚类
- EasyPlayer实现Android MediaMuxer录像MP4(支持G711/AAC/G726音频)
- lua switch
- realloc函数和calloc函数
- Kotlin 定义List 和 Map 等约定写法
- vi/vim 编辑器详解
- json小通讯接口
- 提高编程能力经验
- awk工具详解
- python+selenium+phantomjs 模拟淘宝登陆
- NAND_flash和NOR_flash区别(最详细)