2009-10-06 14:14:16 -06:00
|
|
|
import time
|
|
|
|
from tanks import Pflanzarr
|
|
|
|
import sys
|
|
|
|
|
|
|
|
T = 60*5
|
|
|
|
|
|
|
|
try:
|
|
|
|
while 1:
|
|
|
|
start = time.time()
|
2009-10-07 13:58:23 -06:00
|
|
|
p = Pflanzarr.Pflanzarr(sys.argv[1], sys.argv[2])
|
2009-10-06 14:14:16 -06:00
|
|
|
p.run(int(sys.argv[3]))
|
|
|
|
|
|
|
|
diff = time.time() - start
|
|
|
|
if diff - T > 0:
|
|
|
|
time.sleep( diff - T )
|
|
|
|
|
|
|
|
except:
|
2009-10-07 13:53:51 -06:00
|
|
|
import traceback
|
|
|
|
traceback.print_exc()
|
2009-10-06 14:14:16 -06:00
|
|
|
print 'Usage: python2.6 run_tanks.py data_dir easy|medium|hard max_turns'
|
|
|
|
|
|
|
|
|