def play_dist2_games():
     while True:
         seed = random.randint(0, 10 ** 9)
         game = big_step_game.BigStepGame.from_json(game_data, seed)
         game, moves = bronze.phase_one(game)
         print('played production game %d with seed %d scored %d' % (problem_id, seed, game.move_score))
         yield game.move_score
示例#2
0
def solve(problem_instance, tag_prefix='NOVELTY2 '):
    bsg = big_step_game.BigStepGame.from_json(
        problem_instance.json_data, problem_instance.seed)
#     print(bsg)

    end_bsg, locking_placements = bronze.phase_one(bsg)
#     print(locking_placements)

    _, commands = dummy_phase_two(bsg, locking_placements)
    print(end_bsg)

    for phrase in interfaces.POWER_PHRASES:
        if phrase in commands:
            print('{:>5} {}'.format(
                utils.count_substrings(commands, phrase), phrase))

    return utils.gen_output_raw(
        id=problem_instance.json_data['id'],
        seed=problem_instance.seed,
        commands=commands,
        move_score=end_bsg.move_score,
        power_score=interfaces.compute_power_score(commands),
        tag_prefix=tag_prefix)