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
This commit is contained in:
parent
a900d2d147
commit
942b38e75d
4
main.c
4
main.c
@ -1,5 +1,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#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 <player name>\n", argv[0]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user