diff options
author | Benjamin Summerton <define-private-public@users.noreply.github.com> | 2017-01-11 00:05:41 -0500 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-01-11 06:05:41 +0100 |
commit | 17c62bb54546b4d2f574edeb955162600b4263f3 (patch) | |
tree | 792c2866a6e4f6a6c5b9c5be29ccc0e08a9a1d6c /lib | |
parent | c98a8f3701c4410b6596cee7809f5e18ec6cf6b7 (diff) | |
download | Nim-17c62bb54546b4d2f574edeb955162600b4263f3.tar.gz |
Documented `shuffle` from `random` module (#5204)
Diffstat (limited to 'lib')
-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]) |