Exemplo n.º 1
0
        public static int sim(int player)
        {
            MonteCarloTreeSearch mcts = new MonteCarloTreeSearch(numOfMCiterations);
            Board board = new Board();

            int totalMoves = Board.DEFAULT_BOARD_SIZE * Board.DEFAULT_BOARD_SIZE;

            for (int i = 0; i < totalMoves; i++)
            {
                board = mcts.findNextMove(board, player);
                if (board.checkStatus() != -1)
                {
                    break;
                }
                player = 3 - player;
            }

            return(board.checkStatus());
        }
Exemplo n.º 2
0
        private void PerformOpponentMove(int player)
        {
            board = mcts.findNextMove(board, player);

            FillButtons();

            string s = board.printStatus();

            Debug.Log(s);

            if (s == "Game In progress")
            {
                currentPlayer = 1;
            }
            else
            {
                GameFinished();
            }
        }