mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
fixed bug when the first random(max: float) call is the same value, regardless of randomize() (#5257)
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user