Forum: Ruby Re: More random, please ! :)

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Berger, Daniel (Guest)
on 2006-04-06 22:45
(Received via mailing list)
>  the alphabet randomly and each statistically equal handled
> that each letter  is handled equally from the statistical
> point of view ?

Will this do?

require 'matrix'
letters = ('a'..'z').sort_by{ rand }
m = Matrix[ letters[0..4], letters[5..9], letters[10..14],
letters[15..19], letters[20..24] ]

I think there's a method to break an array into X equal parts, but I
can't recall.


This topic is locked and can not be replied to.