-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 2 New Array Functions #143
Changes from 1 commit
a2f6dfa
f94e787
7dd0d45
fa98055
5e42e56
8931070
c76a338
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,18 @@ class CfgFunctions | |
description = "A function used to return the element counts in an array. Parameters: Array Example: _types = [0,0,1,1,1,1] call CBA_fnc_getArrayElements Returns: Array element counts (for above example, return would be [0,2,1,4]) Author: Rommel && sbsmac"; | ||
file = "\x\cba\addons\arrays\fnc_getArrayElements.sqf"; | ||
}; | ||
// CBA_fnc_getHightestVaule | ||
class getHightestVaule | ||
{ | ||
description = "Use to find Hightest value with index in a array."; | ||
file = "\x\cba\addons\arrays\fnc_getHightestVaule.sqf"; | ||
}; | ||
// CBA_fnc_getLowestVaule | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be |
||
class getLowestVaule | ||
{ | ||
description = "Use to find Hightest value with index in a Array."; | ||
file = "\x\cba\addons\arrays\fnc_getLowestVaule.sqf"; | ||
}; | ||
// CBA_fnc_inject | ||
class inject | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* ---------------------------------------------------------------------------- | ||
Function: CBA_fnc_getHightestVaule | ||
|
||
Description: | ||
Use to find Hightest value with index in a Array. | ||
|
||
Parameters: | ||
_array: Array with Numbers | ||
|
||
Example: | ||
(begin example) | ||
_array = [_array,1] call CBA_fnc_sortNestedArray | ||
(end) | ||
|
||
Returns: | ||
_min: the Max Value | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. _max: the max value |
||
_index: the Index of the Max Value | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ...index of the highest value (or "index of the max value") |
||
|
||
Author: | ||
joko // Jonas | ||
|
||
---------------------------------------------------------------------------- */ | ||
#include "script_component.hpp" | ||
SCRIPT(getLowestValue); | ||
params ["_max"]; | ||
_index = -1; | ||
|
||
{ | ||
if (_max < _x) then {_max = _x; _index = _forEachIndex}; | ||
} forEach _this; | ||
|
||
[_max, _index] // Return |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* ---------------------------------------------------------------------------- | ||
Function: CBA_fnc_getLowestVaule | ||
|
||
Description: | ||
Use to find Hightest value with index in a Array. | ||
|
||
Parameters: | ||
_array: Array with Numbers | ||
|
||
Example: | ||
(begin example) | ||
_array = [_array,1] call CBA_fnc_sortNestedArray | ||
(end) | ||
|
||
Returns: | ||
_min: the Min Value | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. _min: the min value |
||
_index: the Index of the Min Value | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ...index of the lowest value (or "index of the min value", depending on your choice above) |
||
|
||
Author: | ||
joko // Jonas | ||
|
||
---------------------------------------------------------------------------- */ | ||
#include "script_component.hpp" | ||
SCRIPT(getLowestValue); | ||
params ["_min"]; | ||
_index = -1; | ||
|
||
{ | ||
if (_min > _x) then {_min = _x; _index = _forEachIndex}; | ||
} forEach _this; | ||
|
||
[_min, _index] // Return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be
getHighestValue
, check spelling (not just here).