03 - add a command line argument to give the seed

This commit is contained in:
kleph 2017-07-19 03:52:56 +02:00
parent 33bf7ecbe9
commit 46bec1c5d9

View file

@ -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)