From: Dave Bass Date: 2008-07-04T01:32:19+09:00 Subject: Re: pseudo-randomize an array in a consistent order Max Williams wrote: > Does anyone know how to pseudo-randomize an array (eg with a seed) so > that you get the same order every time you do it? If I've understood the problem correctly, can't you set up a lookup table for the array indices? You don't have to change the array itself. The lookup table can be an array, e.g. t[0] = 1 t[1] = 4 t[2] = 2 t[3] = 3 t[4] = 0 Then if the original array is arr, instead of accessing arr[i] you'd access arr[t[i]]. -- Posted via http://www.ruby-forum.com/.