private bool RemoveLonely(ArrayList lonelyColl) { bool bReturn = false; Cell tempCell = LonelyBlend(lonelyColl); foreach (Cell c in cellColl) { bool bFound = false; foreach (Cell c1 in lonelyColl) { if (c1.Row == c.Row && c1.Column == c.Column) { bFound = true; } } if (!bFound) { for (int nCntr = 1; nCntr < 10; nCntr++) { if (tempCell.PossibleValue(nCntr) == 0 && c.PossibleValue(nCntr) == 0) { c.PossibleValue(nCntr, -1); bReturn = true; } } } } return(bReturn); }
private Cell LonelyBlend(Cell cell1, Cell cell2) { Cell returnCell = new Cell(0, 0, 0, 0); int tempStatus = 1; for (int nCntr = 1; nCntr < 10; nCntr++) { tempStatus = 1; if (cell1.PossibleValue(nCntr) == 0 || cell2.PossibleValue(nCntr) == 0) { tempStatus = 0; } returnCell.PossibleValue(nCntr, tempStatus); } return(returnCell); }