summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorBenjamin Summerton <define-private-public@users.noreply.github.com>2017-01-11 00:05:41 -0500
committerAndreas Rumpf <rumpf_a@web.de>2017-01-11 06:05:41 +0100
commit17c62bb54546b4d2f574edeb955162600b4263f3 (patch)
tree792c2866a6e4f6a6c5b9c5be29ccc0e08a9a1d6c /lib
parentc98a8f3701c4410b6596cee7809f5e18ec6cf6b7 (diff)
downloadNim-17c62bb54546b4d2f574edeb955162600b4263f3.tar.gz
Documented `shuffle` from `random` module (#5204)
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/random.nim1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/pure/random.nim b/lib/pure/random.nim
index 0d4996400..7bb54cb8e 100644
--- a/lib/pure/random.nim
+++ b/lib/pure/random.nim
@@ -107,6 +107,7 @@ proc randomize*(seed: int) {.benign.} =
   state.a1 = ui(seed and 0xffff)
 
 proc shuffle*[T](x: var seq[T]) =
+  ## Will randomly swap the positions of elements in a sequence.
   for i in countdown(x.high, 0):
     let j = random(i + 1)
     swap(x[i], x[j])