in reply to Re: Fisher-Yates shuffle?
in thread Fisher-Yates shuffle?
I didn't set out to create a one-liner. I set out to shuffle some test data. I found the Fisher-Yates thing and set about working out how the Perl implementation using slices worked (I haven't done much with slices before now), and came up with the one-liner which on casual inspection appeared to work.
Given Abigail's fix for it's failings, I'm happy to use it, with it's dependancy on subscript evaluation order on the basis that if this ever changes, it will break a lot of other code too, so the change should be well announced.
As for "why ... a one-liner", I will turn that around and ask--Why not?--provided it works.
Isn't it the Perlish way?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Fisher-Yates shuffle?
by demerphq (Chancellor) on Aug 09, 2002 at 18:02 UTC | |
by BrowserUk (Patriarch) on Aug 09, 2002 at 22:43 UTC |