random_each.lua
📑 Source
More efficient loops over random set of items.
Will NOT contain duplicate picks.
local items = {1,2,3} -- Randomly pick half of the items in the table rounded down. random_each(items, on_item, 0.5)