My first idea was to use table.sort along with some random number generator. I could assign each element a random value, and then sort by those, or maybe I could do the whole thing in one step? Someone must have figured out a slick way to do this. My potentially clumsy attempt:
(assume the random number generator has been seeded previously.)
Code: Select all
table = {}
for i=1,100 do
table[i] = i
end
mixer = {}
for i=1, #table do
mixer[i] = math.random()
end
--Mr. Strange