On Wed, Feb 18, 1998 at 07:42:19PM +1100, David Duffy wrote: > But I can't > see a way to generate the list of all 20 numbers in random order. The only If you can generate one truly random seed, you can then use a pseudo-rando number generator to generate a sequence that will be, for your purposes, random. But if your seed is not truly random, you'll get the same sequences repeating. Here's a pseudo-random number generator (from the HI-TECH PIC C library) . You call srand with a random seed, then successive calls to rand() will return a pseudo-random sequence based on that seed. The function is chaotic, i.e. a small variation in the seed causes large variations in the sequence, but it is deterministic, so it will only be as random as your seed. #include static long randx; static char randf; void srand(unsigned x) { randx = x; randf = 1; } int rand(void) { if(!randf) srand(1); return((int)((randx = randx*1103515245L + 12345)>>16) & 077777); } -- Clyde Smith-Stubbs | HI-TECH Software Email: clyde@htsoft.com | Phone Fax WWW: http://www.htsoft.com/ | USA: (408) 490 2885 (408) 490 2885 PGP: finger clyde@htsoft.com | AUS: +61 7 3354 2411 +61 7 3354 2422 --------------------------------------------------------------------------- ANSI C for the PIC! Now shipping! See www.htsoft.com for more info.