Actually, I suspect it's not, just by running it a bunch of times. 20 ends up at or near the tail end most of the time, though it gets more apparently random if I use sort '_quicksort'.sort {rand 1 <=> .5} (1..20) # Update: was using {-1 + int rand 3}
Really, I'd like a succinct explanation of why it's not.
Update: with the changed random -- not having it return zeroes -- it looks somewhat more random.
In reply to Is this a fair shuffle? by Roy Johnson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |