Re: scramble sentence, how to better program?
by 7stud -- other posts by this author
May 8 2008 3:17PM messages near this date
Re: scramble sentence, how to better program?
|
Re: scramble sentence, how to better program?
S2 wrote:
> David A. Black wrote:
>
> > print "Enter a sentence: "
> > puts gets.split.sort_by { rand }.join(" ")
>
> but does this take into account that rand could generate the same numer
> two
> times? while that is not likely, it could happen.
So what?
--
Posted via http://www.ruby-forum.com/.
Thread:
Globalrev
David A. Black
S2
S2
Globalrev
S2
7stud --
David A. Black
Rob Biedenharn
S2
S2
|