Code: Select all
// Script to rearrange array elements in a random order.
//
Let>str=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
Separate>str,COMMA,arr
//
// Rearrange array in random order
Let>k=arr_Count
While>k>0
Let>tmp=arr_%k%
Random>k,valRand
Add>valRand,1
Let>arr_%k%=arr_%valRand%
Let>arr_%valRand%=tmp
Sub>k,1
EndWhile
//
//
// Convert array to string for MDL>
Let>strRes=
Let>k=0
While>k<arr_Count
Add>k,1
Let>tmp=arr_%k%
If>k<>arr_Count
Let>strRes=%strRes%%tmp%%COMMA%
Else
Let>strRes=%strRes%%tmp%
EndIf
EndWhile
//
Let>MSG_HEIGHT=250
Let>MSG_Width=500
MDL>Ori: %str%%CRLF%Res: %strRes%