From ea4397fbb084a8d316ae71eaf4f66941e4e8a97c Mon Sep 17 00:00:00 2001 From: Vladar4 Date: Fri, 20 Jan 2017 20:35:20 +0200 Subject: [PATCH] fixed bug when the first random(max: float) call is the same value, regardless of randomize() (#5257) --- lib/pure/random.nim | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pure/random.nim b/lib/pure/random.nim index b4681610ac..8d463576a4 100644 --- a/lib/pure/random.nim +++ b/lib/pure/random.nim @@ -105,6 +105,7 @@ proc randomize*(seed: int) {.benign.} = ## Initializes the random number generator with a specific seed. state.a0 = ui(seed shr 16) state.a1 = ui(seed and 0xffff) + discard next(state) proc shuffle*[T](x: var openArray[T]) = ## Will randomly swap the positions of elements in a sequence.