摘要: function LuaError(...) local strContent="" for i=1,arg.n,1 do strContent = tostring(strContent)..tostring(arg[i]) if i ~= arg.n then strContent = strC 阅读全文
posted @ 2013-02-25 16:48 byfei 阅读(693) 评论(0) 推荐(0) 编辑
摘要: function getrandom(nMax) math.randomseed(tostring(os.time()):reverse():sub(1, 6)) local tab = {} local tabFin = {} local Rand for i=1,nMax do table.insert(tab,i) end for i=1,table.getn(tab) do Rand = math.random(table.getn(tab)) while tab[Rand] == nil do Rand = math.random(table.getn(tab)) end... 阅读全文
posted @ 2013-02-25 14:47 byfei 阅读(527) 评论(0) 推荐(0) 编辑
摘要: 函数名描述示例结果pi圆周率math.pi3.1415926535898abs取绝对值math.abs(-2012)2012ceil向上取整math.ceil(9.1)10floor向下取整math.floor(9.9)9max取参数最大值math.max(2,4,6,8)8min取参数最小值math.min(2,4,6,8)2pow计算x的y次幂math.pow(2,16)65536sqrt开平方math.sqrt(65536)256mod取模math.mod(65535,2)1modf取整数和小数部分math.modf(20.12)200.12randomseed设随机数种子math.ra 阅读全文
posted @ 2013-02-25 11:48 byfei 阅读(306) 评论(0) 推荐(0) 编辑