Top Level Namespace
- Includes:
- Math, RubyLabs
Defined Under Namespace
Modules: Enumerable, RubyLabs Classes: Fixnum, String
Constant Summary collapse
- SCRIPT_LINES__ =
RubyLabs gem, top level module.
Hash.new
Instance Method Summary collapse
-
#permute!(x) ⇒ Object
:begin :permute! :random.
-
#random(min, max) ⇒ Object
:begin :random.
Methods included from RubyLabs
#TestArray, #count, #hello, #log2, #max, #min, #time, #trace
Instance Method Details
#permute!(x) ⇒ Object
:begin :permute! :random
8 9 10 11 12 13 14 |
# File 'lib/permute.rb', line 8 def permute!(x) for i in 0..x.length-2 r = random(i, x.length-1) x[i], x[r] = x[r], x[i] end return x end |