From 942b38e75d6adc1f430d5069e506eeea061b223c Mon Sep 17 00:00:00 2001 From: Simon Wiesend Date: Sun, 30 Nov 2025 09:11:32 +0100 Subject: [PATCH] set the seed for the RNG just once at the beginning of the program this improves randomness for tests where createNumbers() is called in rapid succession --- main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.c b/main.c index 34163d0..d66f071 100644 --- a/main.c +++ b/main.c @@ -1,5 +1,6 @@ #include #include +#include #include "numbers.h" #include "timer.h" #include "highscore.h" @@ -39,6 +40,9 @@ int main(int argc, char *argv[]) { int exitCode = EXIT_FAILURE; + // set seed + srand(time(NULL)); + if(argc != 2) { fprintf(stderr, "Usage: %s \n", argv[0]);