Example #1
0
        public Nonogram(int[][] rowHints, int[][] columnHints, ILogger logger = null)
        {
            this.rowHints    = rowHints;
            this.columnHints = columnHints;
            this.logger      = logger;
            this.width       = columnHints.Length;
            this.height      = rowHints.Length;
            this.lineSolver  = new LineSolver();

            map = GenerateEmptyMap();
        }
Example #2
0
        private bool IsSolved()
        {
            for (int row = 0; row < height; row++)
            {
                if (!LineSolver.IsLineLogicallyComplete(GetRow(row), rowHints[row]))
                {
                    return(false);
                }
            }

            for (int col = 0; col < width; col++)
            {
                if (!LineSolver.IsLineLogicallyComplete(GetColumn(col), columnHints[col]))
                {
                    return(false);
                }
            }

            return(true);
        }