sorting an array
Moderator: POL Developer
-
- Grandmaster Poster
- Posts: 120
- Joined: Thu Jan 18, 2007 2:34 am
sorting an array
hi basically i just have props stored in a file with their names as numbers. Pol sorts numbers like (10, 100, 11, 12, 13, 14) etc. Is there any way to sort the numbers in a numericaly correct sequence?
http://linux.wku.edu/~lamonml/algor/sort/sort.html
Easiest to code is insert sort (dont use bubble its very slow)
The best for POL scripting would probably be merge sort.
Easiest to code is insert sort (dont use bubble its very slow)
The best for POL scripting would probably be merge sort.
-
- Grandmaster Poster
- Posts: 120
- Joined: Thu Jan 18, 2007 2:34 am
Re: sorting an array
There is a method on arrays to sort them:
Code: Select all
var arr := array{3,2,1};
arr.sort();