Code: Select all
n=51
for i = 0 to n
list(i) = i
next i
for i = 0 to n
x = rnd(n) ; choose a random element between 0..n
t = list(i)
list(i) = list(x)
list(x) = t ; swap element 'x' with element 'i'
next iMaybe something like a function INRANGE? that returns a boolean of whether the index is contained between elements start and start+size
'flag = INRANGE? (index, start, size)'