Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
        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;
        }