summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2020-10-31 23:24:12 +0000
committerIan C <ianc@noddybox.co.uk>2020-10-31 23:24:12 +0000
commit85509c6b2a52b5dd614538248706a49bde315f53 (patch)
treedd8f8a1894a8e465d82113b090da0d6d926e77b1
parenteb45a34b4a0881b227cb1a461ca1fcb77e593865 (diff)
Added optional arguement to seed random number
-rw-r--r--csol.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/csol.c b/csol.c
index 3ff6571..c57d8af 100644
--- a/csol.c
+++ b/csol.c
@@ -146,7 +146,14 @@ int main(int argc, char *argv[])
int opt = 1;
int quit = FALSE;
- srand(time(NULL));
+ if (argc > 1)
+ {
+ srand(atoi(argv[1]));
+ }
+ else
+ {
+ srand(time(NULL));
+ }
initscr();
cbreak();