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