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).
In reply to Re: Empty Elements
by MarkM
in thread Empty Elements
by dopey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |