Functions for dealing with arrays.
Returns the index of the first bit set to true in a bitarray.
The integer index of the first bit set to true in a bitarray, or 0 if no bits are set.
<aBitArray>
Returns true if any bit in a bitarray is set, otherwise false.
Returns true if any bit in a bitarray is set, otherwise false.
<aBitArray>
Returns the number of bits set to true in a bitarray.
The number of bits set to true in a bitarray.
<aBitArray>
Delete items in an array that are tagged via a passed bitarray.
Note: the bitarray and array must be the same size.
True on success, false on failure.
%<anArray>
<aBitArray>
anArray
will be deleted where the corresponding index in this bitarray is true.
Insert an item into an array, after a given index.
True on success, false on failure.
%<anArray>
<item>
<index>
Check if passed item is in passed array.
Shortcut to/clearer than typing ((FindItem anArray anItem) != 0)
True if item is in the array, otherwise false.
<anArray>
<anItem>
Get an interpolated value from an array.
i.e.
GetArrayValue #(red, green, blue) 1.5
will return
(color 127.5 127.5 0)
(or halfway between red and green)
Note: the array values must support the normal compare operators, and allow addition and division with floats.
The interpolated value from the array.
<anArray>
<f>
Get an interpolated value from an array using a normalize 0 to 1 index.
This works exactly like GetArrayValue
, except the index should be normalized to 0.0 to 1.0.
The interpolated value from the array.
<anArray>
<f>
Return the index of the largest (or smallest) value in the array.
The index of the largest (or smallest) value in the array.
<anArray>
Reverse the order of items in array.
OK (updates passed value).
%<anArray>
Scale an array to a new size, with new values linearly interpolated from old values.
A new array with size of "newSize".
<anArray>
<newCount>
Scrambles the order of items in an array.
The default call of ScrambleArray myArray
will scramble the whole thing once over.
OK (updates passed value).
%<anArray>
[passes:1]
[boundMin:1]
[boundMax:-1]
[seedVal:1]
Trims an array down so that it holds only one reference to each item. ie:
TrimDuplicates #(1,2,3,4,3,4,5)
would trim the array to #(1,2,3,4,5)
The more duplicates in the array, the faster it goes.
OK (updates passed value).
%<array>