随笔分类 -  lua语言

摘要:1 --普通表 2 local tab = {1,2,3} 3 4 --元表 5 local meta = { 6 insert = function(t,v) 7 --监测表增加成员 8 print("增加一个值",v) 9 table.insert(t,v) 10 end, 11 remove 阅读全文
posted @ 2024-05-26 18:18 Axuanup 阅读(26) 评论(0) 推荐(0)
摘要:print("********如何实现switch-case********") local switch = { [1] = function() print ("case1") end, [2] = function() print ("case2") end, [3] = function() 阅读全文
posted @ 2020-11-24 00:30 Axuanup 阅读(4361) 评论(0) 推荐(0)