diff options
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; } |
