We have this example
local t = { 3,2,5,1,4 , 6 , 5 , 8, 2} local function compare( a, b ) return a \< b -- Note "\<" as the operator end table.sort( t, compare ) print( table.concat( t, ", " ) ) --\> 1, 2, 2, 3, 4 , 5 , 5 , 6 , 8
Repeat (2) and (5)
How to sort numbers without repeating?