diff options
| author | nic-gaffney <gaffney_nic@protonmail.com> | 2023-06-27 01:59:59 -0500 |
|---|---|---|
| committer | nic-gaffney <gaffney_nic@protonmail.com> | 2023-06-27 01:59:59 -0500 |
| commit | 29bdd10ee3621ed875bfa34a0faa42c35a1e39ed (patch) | |
| tree | 97f7605b53fc77277d98d5ea8127391edefc4ab5 /std/stdmath.c | |
| parent | 9c2d8f5a10b8affd604cec6e394d43514ef93ca1 (diff) | |
| download | sloth-29bdd10ee3621ed875bfa34a0faa42c35a1e39ed.tar.gz | |
Standard library methinks
Diffstat (limited to 'std/stdmath.c')
| -rw-r--r-- | std/stdmath.c | 6 |
1 files changed, 5 insertions, 1 deletions
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 <stdlib.h> #include <time.h> +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; } |
