Module:SandboxT

local p = {}

local function descending (first, second) return first > second end

function p.tablelibrary local numbers = {} local result math.randomseed(os.time) for i = 1, 10, 1 do       table.insert(numbers, math.random(1, 10)) end result = ';random numbers\n' result = result .. ':' .. table.concat(numbers, ', ') .. '\n' table.sort(numbers) result = result .. ';sorted numbers\n' result = result .. ':' .. table.concat(numbers, ', ') .. '\n'

table.remove(numbers, 1) result = result .. ';after removing the first value\n' result = result .. ':' .. table.concat(numbers, ', ') .. '\n'

table.sort(numbers, function(a, b) return a > b end) result = result .. ';sorted in descending order (anon-fcn)\n' result = result .. ':' .. table.concat(numbers, ', ') .. '\n'

table.sort(numbers) result = result .. ';sorted numbers (asc-again)\n' result = result .. ':' .. table.concat(numbers, ', ') .. '\n' table.sort(numbers, descending) result = result .. ':sorted in descending order (local-fcn)\n' result = result .. ':' .. table.concat(numbers, ', ') .. '\n' return result end return p