From cc757d538cd9a2d030f57f71d6767af0b3a6fc90 Mon Sep 17 00:00:00 2001 From: def Date: Fri, 16 Jan 2015 23:58:43 +0100 Subject: [PATCH] Remove shuffle again --- lib/pure/math.nim | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/pure/math.nim b/lib/pure/math.nim index e520720d3..01eee3b15 100644 --- a/lib/pure/math.nim +++ b/lib/pure/math.nim @@ -284,14 +284,6 @@ proc random*[T](a: openArray[T]): T = ## returns a random element from the openarray `a`. result = a[random(a.low..a.len)] -proc shuffle*[T](a: var openArray[T]) = - ## Shuffles the elements in `a`. Note that ``randomize`` needs to be called - ## to initialize the random number generator, otherwise ``shuffle`` always - ## shuffles in the same way. - for i in countdown(a.high, 0): - let j = random(i + 1) - swap(a[i], a[j]) - type RunningStat* = object ## an accumulator for statistical data n*: int ## number of pushed data