From 17c62bb54546b4d2f574edeb955162600b4263f3 Mon Sep 17 00:00:00 2001 From: Benjamin Summerton Date: Wed, 11 Jan 2017 00:05:41 -0500 Subject: [PATCH] Documented `shuffle` from `random` module (#5204) --- lib/pure/random.nim | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pure/random.nim b/lib/pure/random.nim index 0d49964006..7bb54cb8e2 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])