コード例 #1
0
        /// <summary>Reduced a cell by excluding the options of the other.</summary>
        public IEvent And <TSolver>(int index, uint mask)
        {
            unchecked
            {
                var val = m_Values[index];
                var nw  = val & mask;
                m_Values[index] = nw;

                if (nw == SudokuPuzzle.Invalid)
                {
                    throw new InvalidPuzzleException();
                }

                if (SudokuCell.Count(nw) == 1 && SudokuCell.Count(val) != 1)
                {
                    return(ValueFound.Ctor <TSolver>(index, nw));
                }

                return(val != nw ? ReducedOption.Instance : (IEvent)NoReduction.Instance);
            }
        }
コード例 #2
0
 protected virtual void OnValueFound(RcdFndEventArgs e) => ValueFound?.Invoke(this, e);