Exemplo n.º 1
0
def main(args):
    args = parse_args(args)
    warriors = get_warrior_list(args.warriors)
    # Get args
    core_size = int(args.core_size)
    rounds = int(args.rounds)
    max_cycles = int(args.max_cycles)
    no_gui = args.no_gui
    # Init gui
    if no_gui:
        gui = MockGUI(core_size)
    else:
        gui = PyGameGUI(SCREEN_X, SCREEN_Y, core_size)
    # Init game
    game = Game(warriors, core_size, gui, rounds, max_cycles)
    # Play game
    game.play()
    # Print results
    print(game.get_results_string())
    # Close gui
    gui.close()
Exemplo n.º 2
0
def test_game_results():
    warrior_a = Warrior([MOV("I", "#", 1, "}", 0)])
    warrior_b = Warrior([MOV("I", "#", 1, "}", 0)])
    game = Game([warrior_a, warrior_b], max_cycles=20)
    game.get_results_string()