Help with compare()

BlitzMax Forums/BlitzMax Programming/Help with compare()

Ryan Burnside(Posted 2007) [#1]
EDIT: Please move this topic. I clicked the wrong link to get here.


I'm making a vector balls demo and I need to sort my balls based on their angle. Ones with the angle closest to 90 degrees should be rendered last. I know that there is a command to sort linked lists but I just can't seem to get it working. I know that I must impliment this function into my objects but the question is how. Given I have a list called balls and each ball has a direction variable how do I sort this by angular distance from 90 degrees?


tonyg(Posted 2007) [#2]
This should help.


Ryan Burnside(Posted 2007) [#3]
Thanks. I got it working.
I feel obligated to ask is this sorting the fastest type of sorting you can do for a list? I know there are a few different variety's. This is for a 3d vector ball demo so speed becomes an issue when you have a large amount of sorted vector ball points.


marksibly(Posted 2007) [#4]
Hi,

It'll probably be faster to use SortArray.