private static IGrid ClearRange(Point p, NumericValue value, IGrid newGrid) { foreach (var rangeP in new Range(p)) { if (newGrid[rangeP].IsDefined) { continue; } newGrid = newGrid.ExcludeValueFromCell(rangeP, value); if (newGrid[rangeP].IsDefined) { newGrid = ClearRange(rangeP, newGrid[rangeP].Value, newGrid); } } return newGrid; }