mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 11:42:33 +00:00
allow random module to be used in standalone: (#12617)
proc randomized*() uses time releated function which is not available on standalone, so disable this function for standalone.
This commit is contained in:
@@ -625,7 +625,7 @@ proc shuffle*[T](x: var openArray[T]) =
|
||||
doAssert cards == ["King", "Ace", "Queen", "Ten", "Jack"]
|
||||
shuffle(state, x)
|
||||
|
||||
when not defined(nimscript):
|
||||
when not defined(nimscript) and not defined(standalone):
|
||||
import times
|
||||
|
||||
proc randomize*() {.benign.} =
|
||||
|
||||
Reference in New Issue
Block a user