def test_run_for_score_with_prog(prog, seed):
    # Make player bot
    compiler = Compiler()
    prog = compiler.compile(prog)
    room = Room([prog], seed=seed)

    runner = GameRunner(Game)
    runner.run(room, playback=False)
def test_run_for_score(seed):
    # Make default player bot
    compiler = Compiler()
    bot = Game.default_prog_for_bot(GameLanguage.LITTLEPY)
    prog = compiler.compile(bot)
    room = Room([prog], seed=seed)

    runner = GameRunner(Game)
    runner.run(room, playback=False)
示例#3
0
def test_run_for_score(seed, playback):
    # Make default player bot
    compiler = Compiler()
    bot = Game.default_prog_for_bot(GameLanguage.LITTLEPY)
    prog = compiler.compile(bot)
    prog.name = "Mock"

    # get computer players
    players = []
    for _ in range(Game.get_number_of_players() - 1):
        players += [Game.default_prog_for_computer()()]
    room = Room([prog] + players, seed=seed)

    runner = GameRunner(Game)
    runner.run(room, playback=playback)
示例#4
0
def compile(code, features=Features.ALL):
    compiler = Compiler()
    return compiler.compile(code, features=features)