Lua
baidu_30577741
这个作者很懒,什么都没留下…
展开
-
Lua 生成随机数, 并写入文件
function GetRandomText() --math.randomseed( tonumber(tostring(os.time()):reverse():sub(1,6)) ) math.randomseed(os.time()) szText = "" for i = 1, 1000 do nRandomNum = tostring(math.random()):sub(...原创 2018-07-16 15:49:32 · 667 阅读 · 0 评论 -
LUA 算24点 列出所有解法
--MyDebugTools--prioritySUB = 1ADD = 2DIV = 3MUL = 4DIGIT = 5function MergeNode(tbNode1 , tbNode2 , szOperator) tbNode = {} ----ADD---- if szOperator == "+" then tbNode.Nu...原创 2018-07-17 11:15:21 · 550 阅读 · 0 评论 -
lua 一百六十行 实现 2048
GAME_SIZE = 4 -- 4*4 GridsGRID_SIZE = 5 -- 格子大小tbNums = {} -- 存储2048格子数据,二维nScore = 0 -- 玩家分数function GetNumLines(nRows) local szDelimiter = "|" local szModel = "%"..(GRID_SIZE*2+1)....原创 2018-07-20 16:17:20 · 791 阅读 · 0 评论