lua 使用工具
来源:互联网 发布:网站流量统计java代码 编辑:程序博客网 时间:2024/06/06 03:45
function split(s, delim)
local start = 1 local t = {}
while true do
local pos = string.find (s, delim, start, true)
if not pos then
break
end
table.insert (t, string.sub (s, start, pos - 1))
start = pos + string.len (delim)
end
table.insert (t, string.sub (s, start))
return t
end
function getTableLen(input)
local ret = 0
for i, v in pairs(input) do
ret = ret + 1
end
return ret
end
function random_table(input, count)
local temp = {}
for k,v in pairs(input) do
table.insert(temp, v)
end
local selected={}
math.randomseed(os.time())
if #input<=count then return temp end
while #selected < count do
local bingo = math.random(#temp)
table.insert(selected,table.remove(temp, bingo))
end
return selected
end
阅读全文
0 0
- lua 使用工具
- lua-checker工具的编译和使用
- lua 反汇编工具 ChunkSpy 的使用
- 使用EditPlus作为Lua开发工具的方法
- Lua For Windows环境配置及Editplus编辑工具使用
- lua开发工具的使用和环境的配置
- Build Lua with CMake使用CMake工具跨平台编译Lua
- LUA相关工具资源
- LUA相关工具资源
- Lua库和工具
- Lua库和工具
- lua开发工具
- Lua库和工具
- 转:lua 工具类
- Lua开发工具
- LUA开发工具
- lua在线编程工具
- lua调试工具
- 搭建Spring Cloud Eureka 服务的注册和发现小项目
- Unable to locate JAR/zip in file system as specified by the driver definition: mysql-connector-java-
- c++入门小知识
- 美团面试 2017年秋季
- 面试可能遇到的一些问题
- lua 使用工具
- Java学习(3)_数组
- 如何进行结构体排序
- 读书笔记:为什么说参数是按值传递的
- mui 日期的联动
- A*搜索算法以及其实现
- 【bzoj4895】项链分赃(增强版)
- Jquery进度条
- Python文件io流