diff options
-rw-r--r-- | lib/pure/random.nim | 1 |
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]) |