Unbias a random generator: Difference between revisions
Content added Content deleted
(added Lua example) |
(→{{header|Lua}}: redefined randN to not check that bias is within range or store chance) |
||
Line 185:
<lang lua>
local function randN(n)
return function()
if math.random() <
end
end
|