Exemplo n.º 1
0
 protected override int _getOptionValue(FrogsAndToadsPosition position)
 {
     return
         (position
          .GetPossibleFrogMoves()
          .Min(x => position.PlayMove(x).GetPossibleToadMoves().Count));
 }
Exemplo n.º 2
0
        private FrogsAndToadsPosition _getMaximumOption(IEnumerable <FrogsAndToadsPosition> playOptions)
        {
            // No simple linq version of this

            FrogsAndToadsPosition bestOption = null;
            int bestValue = int.MinValue;
            int optionValue;

            foreach (FrogsAndToadsPosition option in playOptions)
            {
                optionValue = _getOptionValue(option);

                if (optionValue > bestValue)
                {
                    bestValue  = optionValue;
                    bestOption = option;
                }
            }

            return(bestOption);
        }
Exemplo n.º 3
0
 protected override int _getOptionValue(FrogsAndToadsPosition option)
 {
     return(_evaluator.RightEvaluation(option));
 }
Exemplo n.º 4
0
 protected abstract int _getOptionValue(FrogsAndToadsPosition option);