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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F3b7b8756d0c7f71cc7460cc33aefaee?d=identicon&s=25 Berger, Daniel (Guest)
on 2006-04-06 20: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 }
letters.delete('j')
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.

Regards,

Dan
This topic is locked and can not be replied to.