From Xojo Documentation
|You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!|
Shuffles (rearranges randomly) the elements of an array.
|array||Any valid data type||The array whose elements will be shuffled.|
Shuffle works on arrays of any data type and any number of dimensions. It is based on a random number. An element of the original array has a roughly equal chance of appearing in any cell of the array after the shuffle, regardless of the size and number of dimensions of the array.
The following example shuffles a one-dimensional array and shows the result in a ListBox.
The following example shuffles a two-dimensional array.
For i=0 to 5
For j=0 to 5