limit iterations for bruteforce2
This commit is contained in:
parent
57e6af6cc8
commit
2afff50f00
1 changed files with 11 additions and 0 deletions
|
@ -92,10 +92,17 @@ def main():
|
|||
else:
|
||||
rot_pallet_default = False
|
||||
|
||||
if os.environ.get("iterations"):
|
||||
max_iter = int(os.environ["iterations"])
|
||||
else:
|
||||
max_iter = -1
|
||||
|
||||
if try_rot_article and try_rot_pallet:
|
||||
product_it = product_varlength(4)
|
||||
elif try_rot_article or try_rot_pallet:
|
||||
product_it = product_varlength(2)
|
||||
|
||||
i = 0
|
||||
while True:
|
||||
rests = list()
|
||||
layers = list()
|
||||
|
@ -151,5 +158,9 @@ def main():
|
|||
print b2a_base64(zlib.compress(cPickle.dumps((layers, rests, pallet)))),
|
||||
if not try_rot_article and not try_rot_pallet:
|
||||
break # only one iteration if both are deactivated
|
||||
i+=1
|
||||
if max_iter != -1 and i >= max_iter:
|
||||
break
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
Loading…
Reference in a new issue