Esempio n. 1
0
        private List <int>[,] FindValidValues(Board board)
        {
            List <int>[,] possibleValues = new List <int> [Board.Size, Board.Size];

            Fill2DArrayWithRange(possibleValues, 1, Board.Size);

            for (int x = 0; x < Board.Size; x++)
            {
                for (int y = 0; y < Board.Size; y++)
                {
                    int value = board.Get(new Point(x, y));
                    if (value != 0)
                    {
                        possibleValues[y, x].Clear();
                        RemoveValueFromRow(possibleValues, y, value);
                        RemoveValueFromCollumn(possibleValues, x, value);
                        RemoveValueFromArea(possibleValues, board.GetAreaStartPointFromPointOnBoard(new Point(x, y)), value);
                    }
                }
            }

            return(possibleValues);
        }