Shuffling an Int Array

BlitzMax Forums/BlitzMax Beginners Area/Shuffling an Int Array

Found much less resource-demanding and more convenient algo (and still more-less "clean"):

SuperStrict
SeedRnd MilliSecs()

Local Nums%[] = [ 1, 1, 2, 3, 5, 8, 13, 21, 34 ]
RandomizeArray( Nums )
PrintArray Nums

Function RandomizeArray( Array%[] )
	Local ArrayLength% = Array.Dimensions()[ 0 ]
	For Local N% = 0 To ArrayLength% - 2
		Local M% = Rand( N%, ArrayLength% - 1)
		Local Z% = Array%[ N% ]
		Array%[ N% ] = Array%[ M% ]
		Array%[ M% ] = Z%
	Next
End Function

Function PrintArray( Array%[] )
	Local Text$
	For Local N% = 0 To Array.Dimensions()[ 0 ] - 1
		Text$ :+ Array%[ N% ] + ", "
	Next
	DebugLog Text$
End Function