function random_table(t, num)
for i,v in pairs(t) do
local r = math.random(#t)
local temp = t[i]
t[i] = t[r]
t[r] = temp
end
num = num or #t
for i = #t,num+1, -1 do
t[i] = nil
lua从固定table中随机出不重复的子table
最新推荐文章于 2021-11-22 15:38:24 发布