Hi all,
just a simple one ( i think ) :-)
i have an array with 52 elements, each being of integer type and being filled with the numbers 1 to 52 respectively.
i want to reorder the elements into a random order, at the moment i use a second array and use rnd to pick numbers from 1 to 52, then use a while loop to repeat this until it has made sure that the rnd number doesnt already exist in the second array, if it doesnt the number is stored in the second array, it repeats this for all 52 elements then reorders the orig. array, only prob is with the while loop it seems very very slow, is there a better/more effecient way to do this?
many thanks
just a simple one ( i think ) :-)
i have an array with 52 elements, each being of integer type and being filled with the numbers 1 to 52 respectively.
i want to reorder the elements into a random order, at the moment i use a second array and use rnd to pick numbers from 1 to 52, then use a while loop to repeat this until it has made sure that the rnd number doesnt already exist in the second array, if it doesnt the number is stored in the second array, it repeats this for all 52 elements then reorders the orig. array, only prob is with the while loop it seems very very slow, is there a better/more effecient way to do this?
many thanks