public override Move Execute()
        {
            var reduced = new List<Move>();

            for (int i = 0; i < 9; i++)
            {
                for (int j = 0; j < 9; j++)
                {
                    if (_engine.values[i, j] > 0)
                        continue;

                    CheckRowColumnAndSquarePossibilities(i, j, _engine.possibles[i, j], reduced);
                }
            }

            if (reduced.Any())
            {
                var move = new ReducePossibilitiesMove();
                move.Reduced = reduced;
                return move;
            }
            else
            {
                return null;
            }
        }
Пример #2
0
        public override Move Execute()
        {
            var reduced = new List <Move>();

            for (int i = 0; i < 9; i++)
            {
                for (int j = 0; j < 9; j++)
                {
                    if (_engine.values[i, j] > 0)
                    {
                        continue;
                    }

                    CheckRowColumnAndSquarePossibilities(i, j, _engine.possibles[i, j], reduced);
                }
            }

            if (reduced.Any())
            {
                var move = new ReducePossibilitiesMove();
                move.Reduced = reduced;
                return(move);
            }
            else
            {
                return(null);
            }
        }
Пример #3
0
 public Move PerformReducePossibilitiesMove(ReducePossibilitiesMove move)
 {
     WriteLog("Reducing possibilities");
     moves.Push(move);
     return move;
 }
Пример #4
0
 public Move PerformReducePossibilitiesMove(ReducePossibilitiesMove move)
 {
     WriteLog("Reducing possibilities");
     moves.Push(move);
     return(move);
 }