From: Robert Dober Date: 2007-02-27T06:00:37+09:00 Subject: Re: extract a random number of items from an array On 2/26/07, Robert Dober wrote: > Ooops bad formatting again, sorry for the repost folks: This seems a mess, I'lll try again Select randomly and unstably n elements from an array: ary.sort_by{ rand }[0..n-1] # or [*1..n] if n< ary.size Select randomly a stable n elements from an array: ary.values_at( *[*0..ary.size-1].sort_by{ rand }[0..n-1].sort ) Hopefully I got it eventually through in plain text. Would be nice if someone could confirm even with a harsh "STOP sending all this crap" ;) Cheers Robert -- We have not succeeded in answering all of our questions. In fact, in some ways, we are more confused than ever. But we feel we are confused on a higher level and about more important things. -Anonymous