From 29bdd10ee3621ed875bfa34a0faa42c35a1e39ed Mon Sep 17 00:00:00 2001 From: nic-gaffney Date: Tue, 27 Jun 2023 01:59:59 -0500 Subject: Standard library methinks --- std/stdmath.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'std/stdmath.c') diff --git a/std/stdmath.c b/std/stdmath.c index 37c81b0..f7f79c6 100644 --- a/std/stdmath.c +++ b/std/stdmath.c @@ -2,8 +2,12 @@ #include #include +bool random_setup = false; int randGen(int min, int max) { - srandom((unsigned) time(NULL)); + if random_setup == false { + srandom(time(NULL)); + random_setup = true; + } return random() % (max - min + 1) + min; } -- cgit v1.2.3