Пример #1
0
def test_simulation(idx):
    """Test that a randomly simulated game doesn't fail."""
    game = Game(
        white_player=RandomAgent,
        black_player=RandomAgent,
    )
    try:
        game.play()
    except Exception as exception:
        print(game.board)
        raise exception
Пример #2
0
def human_vs_machine():
    game = Game(
        white_player=HumanAgent,
        black_player=AlphaBetaAgent,
    )
    game.play(verbose=True)
Пример #3
0
def self_play(verbose=True):
    game = Game(
        white_player=AlphaBetaAgent,
        black_player=AlphaBetaAgent,
    )
    game.play(verbose=verbose)