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:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user