예제 #1
0
        private static bool playout(GameState state, int pIndex)
        {
            GameState playState = state.getNextState(true, null, true);

            while (!playState.gameOver())
            {
                playState = playState.getNextState(true, null, true);
            }

            int bestScore = state.getBestScore();

            return(bestScore == pIndex);
        }
예제 #2
0
        private static int getPlayouts(GameState state, Card card, int pIndex)
        {
            int wins = 0;

            if (state.gameOver()) return 0;
            GameState playState = state.getNextState(true, card, true);
            for (int i = 0; i < NUM_PLAYOUTS; i++)
            {
                if (playout(playState, pIndex))
                    wins++;
            }
            return wins;
        }
예제 #3
0
        private static int getPlayouts(GameState state, Card card, int pIndex)
        {
            int wins = 0;

            if (state.gameOver())
            {
                return(0);
            }
            GameState playState = state.getNextState(true, card, true);

            for (int i = 0; i < NUM_PLAYOUTS; i++)
            {
                if (playout(playState, pIndex))
                {
                    wins++;
                }
            }
            return(wins);
        }