So I'm trying out some arrays and I would really like to know how I would sort the following array
array(family's Y co-ordinate, family's variable, UID if necessary)
So far it's proving to be a killer, I've looked up some sorting algorithms but I'm not too savvy on a lot of the lingo they use to define them. The sorting algorithms that looked nice were, bubble, gnome and possibly insert, I'm not sure how they apply to multi-dimensional arrays though.
I want the array to look something like this when it's sorted (leaving UID out for now):
So primarily sorting by the Y co-ordinate ascending, but if any of the family have the same Y co-ordinate then sort by their private variable ascending
Is this possible at the moment? I'm assuming its to do with a bunch of nested loops, but it's 3:20am and my brain has imploded
Remember, I'm not that mathy, you'll have to translate into english for me
For those that are interested, I got it working, however it didn't solve my problem so its back to the drawing board
Develop games in your browser. Powerful, performant & highly capable.
Yeah there really is no specific way to sort floats or integers, other than making up your own.
I wonder if its possible to have a object, or behavior that could do that for you.
Edit I suppose Lucid's S plug could do it, perhaps he could give an example of how that might work.