diff options
Diffstat (limited to 'npc/functions')
-rw-r--r-- | npc/functions/array.txt | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/npc/functions/array.txt b/npc/functions/array.txt index 1bc54610d..d433abd71 100644 --- a/npc/functions/array.txt +++ b/npc/functions/array.txt @@ -215,40 +215,6 @@ function script array_difference { -// array_product(<array>) -// return the product of every element of the array - -function script array_product { - .@size = getarraysize(getarg(0)); - freeloop(true); - - for (.@i = getarrayindex(getarg(0)); .@i < .@size; ++.@i) { - .@prod *= getelementofarray(getarg(0), .@i); - } - - freeloop(false); - return .@prod; -} - - - -// array_quotient(<array>) -// return the product of every element of the array - -function script array_quotient { - .@size = getarraysize(getarg(0)); - freeloop(true); - - for (.@i = getarrayindex(getarg(0)); .@i < .@size; ++.@i) { - .@quot /= getelementofarray(getarg(0), .@i); - } - - freeloop(false); - return .@quot; -} - - - // array_shift(<array>) // returns the first element of the array and removes it, while shifting left @@ -298,6 +264,7 @@ function script array_pop { } + // TODO: Rename to array_append >.< // array_push(<array>, <value>) // adds <value> to the end of the array |