reporting a sortList bug
Avatar is a class This class contains x,y coordinate which i define here in array avatars:
avatars=[] avatars.insert(new Avatar(50,-50)) avatars.insert(new Avatar(-10,-40)) avatars.insert(new Avatar(-20,-30))
I tried to sort it with calling
avatars.sortList(function(a1,a2) return a1.y<a2.y end)
And when i print the sorted array the values are: -30,-40,-50
for a in avatars print(a.y) end
When i turn around the condition in sortList to return a1.y>a2.y then the result of sort is again : -30,-40,-50