moth/tanks/run_tanks.py

23 lines
442 B
Python
Raw Normal View History

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])
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()
print 'Usage: python2.6 run_tanks.py data_dir easy|medium|hard max_turns'