Exemplo n.º 1
0
        private bool SingleCandidatesInRow(int index)
        {
            IDictionary<int, CandidateHelper> unique = UniquePencilmarks(GetRow(index));

            if(unique.Count == 0)
            {
                return false;
            }

            foreach (var item in unique)
            {
                int key = item.Key;
                CandidateHelper value = unique[key];
                AssignCell(index, value.Coordinates.X, key);
            }

            return true;
        }
Exemplo n.º 2
0
        private static IDictionary<int, CandidateHelper> FilterUniques(IDictionary<int, CandidateHelper> c)
        {
            Dictionary<int, CandidateHelper> unique = new Dictionary<int, CandidateHelper>();

            foreach (var kvp in c)
            {
                int key = kvp.Key;
                CandidateHelper value = c[key];

                if (value.Count == 1)
                {
                    unique.Add(key, value);
                }

            }

            return unique;
        }
Exemplo n.º 3
0
        private bool SingleCandidatesInArea(int index)
        {
            IDictionary<int, CandidateHelper> unique = UniquePencilmarks(GetArea(index));

            if (unique.Count == 0)
            {
                return false;
            }

            int deltaX;
            int deltaY;

            GetAreaCoordinates(index, out deltaX, out deltaY);

            foreach (var item in unique)
            {
                int key = item.Key;
                CandidateHelper value = unique[key];
                AssignCell(deltaY + value.Coordinates.Y, deltaX + value.Coordinates.X, key);
            }

            return true;
        }
Exemplo n.º 4
0
 internal CandidateHelper(CandidateHelper h)
     : this(h.Count + 1, h.Coordinates.X, h.Coordinates.Y)
 {
 }