示例#1
0
        private bool RemoveUnsolvedValueFromCellsNotInSquare(ref Board board, int unsolvedValue, int squareNumber, CellData cells)
        {
            bool success = false;

            foreach (int cellIndex in cells.Keys)
            {
                if (GridMath.GetSquareForIndex(cellIndex) != squareNumber)
                {
                    bool removalSucceeded = board.RemoveValueFromCell(cellIndex, unsolvedValue);
                    success |= removalSucceeded;
                }
            }

            return(success);
        }
示例#2
0
 public void TestSquareForIndex(int index, int expectedSquare)
 {
     GridMath.GetSquareForIndex(index).Should().Be(expectedSquare);
 }