From 46bec1c5d953dec3c258e41283552841d249f8dc Mon Sep 17 00:00:00 2001 From: kleph Date: Wed, 19 Jul 2017 03:52:56 +0200 Subject: [PATCH] 03 - add a command line argument to give the seed --- 03_map.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/03_map.py b/03_map.py index c8c100d..aa0b8d2 100644 --- a/03_map.py +++ b/03_map.py @@ -263,7 +263,10 @@ def on_draw(): # init random -seed = random.randint(0, sys.maxsize) +if len(sys.argv) > 1: + seed = int(sys.argv[1]) +else: + seed = random.randint(0, sys.maxsize) print("Using seed: " + str(seed)) random.seed(seed)