1
我想排序,但有一個零。我怎樣才能解決這個問題?排序表 - Lua
代碼IM期運用:(按名稱和惠普排序它萬一有重複的HPS)
T = { {Name = "Mark", HP = 54, Breed = "Ghost"},
{Name = "Stan", HP = 24, Breed = "Zombie"},
{Name = "Juli", HP = 100, Breed = "Human"},
{ HP = 100, Breed = "Human"}
}
function Sorting(T)
table.sort(T,
function(x,y)
return x.Name < y.Name and x.HP < y.HP
end
)
end
使用縮進來自動格式化代碼示例。 – outis 2009-11-01 07:53:19