nicknames = {
"Mike",
"John",
"Lenny",
"Ariel",
"Yngwie",
}
function sortByName(tableToSort)
table.sort(tableToSort)
end
sortByName(nicknames)
for i, v in pairs(nicknames) do
print(i, v)
end
table.sort 의 comparision 함수의 기본값은 a < b
Saturday, May 12, 2012
table.sort 간단 예제
Labels:
Lua
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment