On 4/7/06, Robert Ammerman wrote: > > If, as in the example of the rotors, your random table contains only > unique > values in the range 0 through N-1 (or 1 through N), then you simply need > another table of the same size that is the 'inverse' of the first table. > (ie: if the first table has the value M as position N, then the reverse > table has the value N at position M). Yup, I looked at that implementation as well, but the tables are a pain to build, and doing two of them that way, felt like a 2^x sort of ickyness. Doing the reverse lookup was dead easy, and speed is NOT an issue. I would like to find a way to do those tables in a more automated fashion, because I'd like to work with some full-byte rotors (0-255) and populating those with random values, while assuring that no value is repeated, isn't all that easy. -- > Feel the power of the dark side! Atmel AVR -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist