aboutsummaryrefslogtreecommitdiff
path: root/rng.ha
diff options
context:
space:
mode:
Diffstat (limited to 'rng.ha')
-rw-r--r--rng.ha4
1 files changed, 4 insertions, 0 deletions
diff --git a/rng.ha b/rng.ha
index d016e15..4ed160a 100644
--- a/rng.ha
+++ b/rng.ha
@@ -34,6 +34,10 @@ export fn main() void = {
};
};
+ if (nodups && max < nb) {
+ fmt::fatal("Can't generate the desired number of randoms without duplicates");
+ };
+
let seed = time::unix(time::now(time::clock::MONOTONIC));
let r = random::init(seed: u32);
let rngs: []u32 = [];