Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- math.sort = function(numlist)
- local numbers = {}
- for a = 1, #numlist do
- if tonumber(numlist[a]) then
- numbers[#numbers+1] = tonumber(numlist[a])
- end
- end
- local output = {}
- local nextnum
- for a = 1, #numbers do
- nextnum = math.min(table.unpack(numbers))
- output[#output+1] = nextnum
- for b = 1, #numbers do
- if numbers[b] == nextnum then
- table.remove(numbers,b)
- break
- end
- end
- end
- return output
- end
- local tArg = {...}
- print(table.concat(math.sort(tArg),", "))
Add Comment
Please, Sign In to add comment