From: Meino Christian Cramer Date: 2006-03-31T05:57:15+09:00 Subject: Re: From: James Edward Gray II Subject: Re: Date: Fri, 31 Mar 2006 05:39:15 +0900 Hi James, again the ruby-effect: The way to code things in ruby is just too straight forward and (only meant positively) simple. Again, I was thinking way too complex.....with no result at all. Thanks a lot! :) Have a nice time! mcc > On Mar 30, 2006, at 2:33 PM, Meino Christian Cramer wrote: > > > Hi; > > > > I am looking for an algorithm, which spread all 26 letters of the > > alphabet over an array of 26 places randomly. All letters should be > > statistically equally handled. > > Well, this is only as good as the random number generator, but it > sure is easy: > > >> ("a".."z").sort_by { rand } > => ["s", "m", "q", "j", "f", "r", "z", "e", "l", "k", "y", "v", "g", > "d", "x", "p", "w", "a", "b", "c", "i", "t", "h", "o", "u", "n"] > > Hope that helps. > > James Edward Gray II >