BIS fnc arrayShuffle: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[Category\:Function Group\: Arrays(\|\{\{[a-zA-Z0-9_:]+\}\})?\]\]" to "")
m (Text replacement - "_{10,} " to "")
Line 1: Line 1:
{{Function|Comments=
{{Function|Comments=
____________________________________________________________________________________________


| arma3 |Game name=
| arma3 |Game name=
Line 7: Line 6:


|gr1= Arrays|GROUP1=
|gr1= Arrays|GROUP1=
____________________________________________________________________________________________


| Return a new array with randomized order of elements from input array. |Description=
| Return a new array with randomized order of elements from input array. |Description=
____________________________________________________________________________________________


| array call [[BIS_fnc_arrayShuffle]] |Syntax=
| array call [[BIS_fnc_arrayShuffle]] |Syntax=
Line 17: Line 14:


| [[Array]] - a new array instance |Return value=
| [[Array]] - a new array instance |Return value=
____________________________________________________________________________________________


|x1= <code>[1,2,3] [[call]] [[BIS_fnc_arrayShuffle]]; {{codecomment|// can return '''[1,2,3]''', [3,1,2], [2,3,1], [1,3,2], [2,1,3] or [3,2,1]}}</code> |Example 1=
|x1= <code>[1,2,3] [[call]] [[BIS_fnc_arrayShuffle]]; {{codecomment|// can return '''[1,2,3]''', [3,1,2], [2,3,1], [1,3,2], [2,1,3] or [3,2,1]}}</code> |Example 1=
____________________________________________________________________________________________


| [[sort]], [[BIS_fnc_sortBy]], [[random]] |See also=
| [[sort]], [[BIS_fnc_sortBy]], [[random]] |See also=

Revision as of 23:33, 16 January 2021

Hover & click on the images for description

Description

Description:
Return a new array with randomized order of elements from input array.
Execution:
call
Groups:
Arrays

Syntax

Syntax:
array call BIS_fnc_arrayShuffle
Parameters:
array: Array
Return Value:
Array - a new array instance

Examples

Example 1:
[1,2,3] call BIS_fnc_arrayShuffle; // can return [1,2,3], [3,1,2], [2,3,1], [1,3,2], [2,1,3] or [3,2,1]

Additional Information

See also:
sortBIS_fnc_sortByrandom

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Bottom Section