by Xephyrous · 13y ago · 0 comments
from http://docs.python.org/2/library/traceback.html#traceback-ex...
In game.py, at the top, put
import sys, traceback
and around line 285, replace this: except Exception:
next_action = ['guard']
with this: except Exception:
print "The robot at (%s, %s) raised an exception:" % robot.location
print '-'*60
traceback.print_exc(file=sys.stdout)
print '-'*60
next_action = ['guard']
That makes your robot a lot easier to debug. Awesome game, have you thought about putting it on github so people can submit patches?