
lua
jebe7282
Fond of Computer Programming
展开
-
lua 通用函数
function tomoney(num) nums = tostring(num) local out = "" local j = 1 for i = string.len(nums) , 1 ,-1 do local sc = string.byte(nums , i) out = out..string.char(sc) if (j%3 == 0 and i ~=1)原创 2013-08-29 11:29:02 · 879 阅读 · 7 评论 -
Lua 之 奇葩的默认参数 设置
function test(a) a = a or 1 print(a) end test() test(2) console: 1 2 function test(a) a = a or true print(a) end test() test(false) 两个居然 都 是true 判断 bool 类型时用这个方法。 f原创 2013-11-07 12:09:00 · 10384 阅读 · 1 评论