Randomize a list

BlitzMax Forums/BlitzMax Programming/Randomize a list

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

This seems to do the trick...

Method Compare(O:Object) 'Override Original Compare
		Select SortBy
		Case CSORT_RANDOM
			If Rand(list.Count()/2) = 1 Then Return -1 Else Return 1
		EndSelect
	EndMethod


It's slower than a normal sort but it gets the job done. :)