03 - add a command line argument to give the seed
This commit is contained in:
parent
33bf7ecbe9
commit
46bec1c5d9
1 changed files with 4 additions and 1 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue