diff options
| -rw-r--r-- | Python/SyncRNG.py | 3 | ||||
| -rw-r--r-- | README.md | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/Python/SyncRNG.py b/Python/SyncRNG.py index 7ef6fd6..0ab4c06 100644 --- a/Python/SyncRNG.py +++ b/Python/SyncRNG.py @@ -6,6 +6,7 @@ used to seed and pull numbers from the RNG. from __future__ import division +from copy import deepcopy from warnings import warn as _warn import syncrng @@ -40,7 +41,7 @@ class SyncRNG(object): return int(r*maxsize) % n def shuffle(self, x): - y = x[:] + y = deepcopy(x) for i in reversed(range(1, len(y))): j = self.randbelow(i+1) y[i], y[j] = y[j], y[i] @@ -34,7 +34,7 @@ Similarly, after installing the R library you can do in R: ```R library(SyncRNG) -s = SyncRNG(seed=123456) +s <- SyncRNG(seed=123456) for (i in 1:10) { cat(s$randi(), '\n') } |
