コード例 #1
0
ファイル: Grid.cs プロジェクト: WinstonSmith77/Sudoku
        public IGrid ExcludeValueFromCell(Point p, NumericValue value)
        {
            var clone = new Grid(this);

            clone._grid[p.X, p.Y] = clone._grid[p.X, p.Y].ExcludeValue(value);

            return clone;
        }
コード例 #2
0
ファイル: Grid.cs プロジェクト: WinstonSmith77/Sudoku
        public IGrid SetCell(Point p, NumericValue toSet)
        {
            var clone = new Grid(this);

            foreach (var value in Cell.Cell._allNumericValues)
            {
                if (value == toSet)
                {
                    continue;
                }
                clone._grid[p.X, p.Y] = clone._grid[p.X, p.Y].ExcludeValue(value);
            }

            return clone;
        }
コード例 #3
0
ファイル: Grid.cs プロジェクト: WinstonSmith77/Sudoku
        private static bool SameContent(Grid grid, Grid other)
        {
            for (int x = 0; x < Extension; x++)
            {
                for (int y = 0; y < Extension; y++)
                {
                    if (!grid._grid[x, y].Equals(other._grid[x, y]))
                    {
                        return false;
                    }
                }
            }

            return true;
        }