http://qs321.pair.com?node_id=264239


in reply to Empty Elements

I believe you intended your second last line to read:

$DECK[$_-1] = $i;

Note, however, that your algorithm wastes valuable entropy, and is inefficient. Wasted entropy can reduce the effective period of a rand() function. The inner loop could also, in theory, loop indefinately (although for the expected scenario, it would loop 100 times or less).