Beispiel #1
0
        private void CheckNakedSingle(NakedTweenFindingMessage message)
        {
            if (possibleNumbers.Count == 2 && message.PairValues.ToList().TrueForAll(x => possibleNumbers.Contains(x)))
            {
                RemoveThisNumbersMessage removeThisNumbersMessage = new RemoveThisNumbersMessage(possibleNumbers.ToArray());

                switch (message.CellNeighbourhood)
                {
                case CellNeighbourhood.Row:
                    rowCells.Except(new [] { Sender }).AsParallel().ForAll(x => x.Tell(removeThisNumbersMessage));
                    break;

                case CellNeighbourhood.Column:
                    columnCells.Except(new[] { Sender }).AsParallel().ForAll(x => x.Tell(removeThisNumbersMessage));
                    break;

                case CellNeighbourhood.Square:
                    squareCells.Except(new[] { Sender }).AsParallel().ForAll(x => x.Tell(removeThisNumbersMessage));
                    break;
                }
            }
        }
Beispiel #2
0
 private void RemoveCluesNumbers(RemoveThisNumbersMessage message)
 {
     possibleNumbers = possibleNumbers.Except(message.Numbers).ToList();
     ProcessClues();
 }