Пример #1
0
def run(args):
    try:
        map, candidates = args
        sys.stderr.write('.')
        runner = platform.ConsoleRunner()
        app = application.CaptureTheFlag(list(candidates),
                                         map,
                                         quiet=True,
                                         games=1)
        runner.run(app)
        sys.stderr.write('o')
        return map, app.scores
    except KeyboardInterrupt:
        return None
Пример #2
0
def run(args):
    try:
        level, commanders = args
        sys.stderr.write('.')
        runner = platform.ConsoleRunner()
        runner.accelerate()
        app = application.CaptureTheFlag(list(commanders), level, quiet = True, games = 1)
        runner.run(app)
        sys.stderr.write('o')
        return level, app.scores
    except Exception as e:
        print >> sys.stderr, str(e)
        tb_list = callstack.format(sys.exc_info()[2])
        for s in tb_list:
            print >> sys.stderr, s
        raise
    except KeyboardInterrupt:
        return None