Пример #1
0
        public bool SolveStep(Nonogram n)
        {
            bool madeChanges = false;

            for (int y = 0; y < n.height; y++)
            {
                var row = n.Row(y);

                foreach (var t in techniques)
                {
                    madeChanges |= t.Apply(row);
                }
            }

            for (int x = 0; x < n.width; x++)
            {
                var col = n.Column(x);

                foreach (var t in techniques)
                {
                    madeChanges |= t.Apply(col);
                }
            }

            return(madeChanges);
        }
Пример #2
0
        public bool Solve(Nonogram n)
        {
            while (SolveStep(n))
            {
                ;
            }

            return(n.IsComplete());
        }