All, I have an application that I need to generate a random number sequence for. Not just a random number, I know how to do that, but an entire pseudo random sequence. The sledge-hammer approach would be to generate a random number, see if it is already in the sequence and store it if it is new, then generate a new random number. Early in the process this would work OK, but when I need the last four numbers the time required to generate the numbers could be excessive to say the least. The details: - The user will have a random number of sound files (2 to 127) on a memory card. - The PIC will count the number of available files and create a random number sequence that is non-repeating and inclusive of all file numbers. (Each file is assigned a number so that I don't need to 'shuffle' the file names, just the numbers.) I can skip files numbers that are greater than the number available but a sequence that stops at the maximum would be nice. - The PIC will select the first file number and send the file to a player. - Once that file is played the PIC will select the next file number in the sequence and send it to the player. - Once all songs have been played once, the PIC will generate a new random sequence and start over. Suggestions or pointers are greatly appreciated. Phil -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist