예제 #1
0
        public IEnumerable <IState> GetNeighbors()
        {
            if (BoardEvaluator.IsWin(Board, Turn.GetReversePlayer()))
            {
                return(new List <IDeterministicState>());
            }

            var result = new List <Connect4State>();

            for (int col = 0; col < ColCount; col++)
            {
                var newState = AddPieceTo(col);
                if (newState != null)
                {
                    result.Add(newState);
                }
            }

            return(result);
        }
예제 #2
0
 public double Evaluate(int depth, List <IState> passedThroughStates) =>
 BoardEvaluator.Evaluate(Board);