コード例 #1
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;
            }
        }
コード例 #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);
 }