Exemplo n.º 1
0
        agent.clear_history()

    return win_or_tie


while True:

    print(
        "The number of wins are : {}\nThe number of loses : {}\nThe number of ties is : {}"
        .format(num_win, num_lose, num_tie))

    if (num_win + num_lose + num_tie) == 30000:
        break

    #moves
    x, y = moves.random_move(game.board)

    game.take_move(x, y, -1)

    print(game)

    #check
    win_or_tie = check_board_and_may_update_state_values()
    if win_or_tie:
        continue

    #RL AI move
    x, y = agent.next_move(game.board)
    game.take_move(x, y, 1)
    agent.cache_move(game.board)
    print(game)