2015-09-19 20:27:23 +00:00
|
|
|
/*
|
|
|
|
* Author: Ruthberg
|
|
|
|
* Sorts an array of numbers
|
2015-01-16 23:21:47 +00:00
|
|
|
*
|
2015-09-19 20:27:23 +00:00
|
|
|
* Arguments:
|
|
|
|
* 0: array <ARRAY>
|
|
|
|
* 1: ascending (optional) <BOOL>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* sortedArray (ARRAY)
|
|
|
|
*
|
2016-07-25 18:00:41 +00:00
|
|
|
* Public: No
|
2015-01-16 23:21:47 +00:00
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2016-07-25 18:00:41 +00:00
|
|
|
ACE_DEPRECATED(QFUNC(insertionSort),"3.8.0","sort");
|
2015-01-16 23:21:47 +00:00
|
|
|
|
2016-07-25 18:00:41 +00:00
|
|
|
params [["_list", [], [[]]], ["_ascending", true, [false]]];
|
2015-01-16 23:21:47 +00:00
|
|
|
|
2016-07-25 18:00:41 +00:00
|
|
|
_list = + _list; // copy array to not alter the original one
|
|
|
|
_list sort _ascending;
|
2015-09-19 20:27:23 +00:00
|
|
|
_list
|