D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Array
/
Filename :
shuffle-i.ri
back
Copy
U:RDoc::AnyMethod[iI"shuffle:ETI"Array#shuffle;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"PReturns a new array containing all elements from +self+ in a random order, ;TI"Fas selected by the object given by the keyword argument +random+:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"3a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] ;TI"3a.shuffle # => [0, 8, 1, 9, 6, 3, 4, 7, 2, 5] ;TI"3a.shuffle # => [8, 9, 0, 5, 1, 2, 6, 4, 7, 3] ;T:@format0o; ; [I"%Duplicate elements are included:;T@o;; [I"3a = [0, 1, 0, 1, 0, 1, 0, 1, 0, 1] ;TI"3a.shuffle # => [1, 0, 1, 1, 0, 0, 1, 0, 0, 1] ;TI"3a.shuffle # => [1, 1, 0, 0, 0, 1, 1, 0, 0, 1] ;T; 0o; ; [I"`The object given with the keyword argument +random+ is used as the random number generator.;T@o; ; [I"NRelated: see {Methods for Fetching}[rdoc-ref:Array@Methods+for+Fetching].;T: @fileI" array.rb;T:0@omit_headings_from_table_of_contents_below0I"*shuffle(random: Random) -> new_array ;T0[ I"(random: Random);T@#FI" Array;TcRDoc::NormalClass00