I would start with a sorted list and then swap list members randomly for as long as I want:
In Pseudocode --
no_values= 100 ' number of list members
dim x[no_values] ' the target list
' fill array:
for i=0 to no_values
x[i]= i
next i
' shuffle array members:
no_swaps= no_values
for i=0 to no_swaps
y= rnd(no_values)
z= rnd(no_values)
swap(x[y], x[z])
next i
I'm not sure how big
no_swaps needs to be to effectively destroy any order that had been in the array... that would require some experimentation. But you'd safe yourself all the conditional branches...
syzygy