[alexandria-devel] Fwd: Knuth-Fisher-Yates shuffle

Nikodemus Siivola nikodemus at random-state.net
Wed Dec 19 13:12:19 UTC 2007


On Dec 13, 2007 5:32 PM, Nikodemus Siivola <nikodemus at random-state.net> wrote:
>
> On Dec 13, 2007 4:58 PM, Sean Ross <rosssd at gmail.com> wrote:
>
> >  I stumbled across this (http://www.codinghorror.com/blog/archives/001015.html)
> >  a little while ago and thought that alexandria's shuffle could do
> > with an update.
> >
> >  Please find the attached patch which updates the shuffle function.
>
> Gods, this is embarrassing! It was supposed to be the Knuth shuffle -- but
> naturally I managed to screw it up when I decided to reverse the loop.
>
> Thanks for the catch!

Merged now -- I also made SHUFFLE suck slightly less on lists while at it.

Cheers,

 -- Nikodemus



More information about the alexandria-devel mailing list