Hi,
I need to shuffle an array with numbers in a random way, let's say cardnumbers (in fact something else that has to do with neural networks but the same procedure).
Now I think this has to be a loop, run at least once in which the condition has to be that the array already holds the number in which case a new randomnumber is set, looping unitl this number is not yet in the array.
Like:
FOR c = Nr1 to Nr2+1
DO
x = RND(Nr1,NR2)
UNTIL (x NOT in ArrayOfNumbers())
ArrayOfNumbers(c) = x
NEXT
Or does anyone have a better solution?
tnx
Marc
I need to shuffle an array with numbers in a random way, let's say cardnumbers (in fact something else that has to do with neural networks but the same procedure).
Now I think this has to be a loop, run at least once in which the condition has to be that the array already holds the number in which case a new randomnumber is set, looping unitl this number is not yet in the array.
Like:
FOR c = Nr1 to Nr2+1
DO
x = RND(Nr1,NR2)
UNTIL (x NOT in ArrayOfNumbers())
ArrayOfNumbers(c) = x
NEXT
Or does anyone have a better solution?
tnx
Marc