BIS fnc arrayShuffle: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Remove informative note)
m (Some wiki formatting)
 
(23 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Function|= Comments
{{RV|type=function
____________________________________________________________________________________________


| arma3 |Game name=
|game1= arma3
|version1= 0.58


|0.58|Game version=
|gr1= Arrays
____________________________________________________________________________________________


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


| array call [[BIS_fnc_arrayShuffle]] |Syntax=
|s1= array call [[BIS_fnc_arrayShuffle]]


|p1= array: [[Array]] |Parameter 1=
|p1= array: [[Array]]


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


|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= <sqf>[1,2,3] call BIS_fnc_arrayShuffle; // can return [1,2,3] (the original order), [3,1,2], [2,3,1], [1,3,2], [2,1,3] or [3,2,1]</sqf>
____________________________________________________________________________________________


| [[sort]], [[BIS_fnc_sortBy]], [[random]] |See also=
|seealso= [[sort]] [[BIS_fnc_sortBy]] [[random]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Functions|{{uc:arrayShuffle}}]]
[[Category:Function Group: Arrays|{{uc:arrayShuffle}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:arrayShuffle}}]]

Latest revision as of 00:13, 13 July 2022

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] (the original order), [3,1,2], [2,3,1], [1,3,2], [2,1,3] or [3,2,1]

Additional Information

See also:
sort BIS_fnc_sortBy random

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