How can I make a function that:
- Randomizes a number (math.random)
- Makes sure it has never been used before
- Goes to 11 after 10 iterations
The second step is the trickiest.
I have:
[lua]i = 0
local function choose()
result = math.random(1,10)
i = i + 1
if i < 10 then
–DO SOMETHING HERE to make sure the random number is not the same as the last one
end
end[/lua]
What is the best way to going about this? I was thinking maybe add all result values to a table and search it in the do something block.
thank you,
Scott
[import]uid: 59735 topic_id: 29781 reply_id: 329781[/import]