function multRandom(min, max, count)
local result = {}
local maxCount = max + 1 - min
if count > maxCount then
return result
end
local unMatchTab = {}
for i = 1, count do
local ret = math.random(min, max)
local r = unMatchTab[ret] or ret
table.insert(result, r)
if r ~= max then
unMatchTab[ret] = unMatch[max] or max
end
max = max - 1
end
end
网友评论