@@ -1,5 +1,18 @@ local fn = {} + +fn.shuffle = function(list) + for i = #list, 2, -1 do + local j = math.random(i) + list[i], list[j] = list[j], list[i] + end +end + +fn.scramble = function(list) + local new = table.copy(list) + fn.shuffle(new) + return new +end fn.copy = function(t) local new = {} for i,v in pairs(t) do new[i] = v end