2 1
41131
1 2 ___#_
2 1 ##x#x
1 2 #__#_
1 #xxxx
2 1 _#_x#
I believe at this point the tactic of "just find a cell that must be black based only on data from its row or column" fails. We can continue only by "using our heads" (i.e. "backtracking"), or by starting to mark cells that must be empty based on data from only their row or column. The cell with the capital X below must be empty because of data in row 3. But the JavaScript didn't auto-mark it with an X. Maybe this is just a logic bug in the JavaScript?: 2 1
41131
1 2 ___#_
2 1 ##x#x
1 2 #X_#_
1 #xxxx
2 1 _#_x#
And from there we can solve column 2, row 1, row 3, and row 5, in that order.I don't think it's a bug in the javascript either, it seems intentional that it only fills in the x's automatically if you've filled in the squares for that row/column.
1 1 1
2 1 1 2 1
2 . . . . .
2 . . . . .
11 . . . . .
2 . . . . .
11 . . . . .
This puzzle has a unique solution (141a706), but none of the clues immediately tell you anything about the state of any specific cell.[spoiler alert]
Naming the coumns ABCDE from left to right, and the rows 12345 from top to bottom. Let's consider B2 near the top left. If B2 full:
Then B1 is empty because B has "only" ones. Then the "two" block in row 1 must make D1 full. Then D2 is also full because D has a "two". Now B2 and D2 are full, but that's impossible because B has only a "two".
So the B2 must be empty. From that point it's possible to fill all the others without "guessing".
So no branches and 3 steps to get a contradiction. I can run that in my head, so I call it "thinking" instead of "backtracking".
1 1 1
1 1 1 2 1
2 . . . . .
2 . . . . .
11 . . . . .
11 . . . . .
1 . . . . . 1 1 1
1 1 1 2 1
2 x x . . .
2 . . x x .
11 x . . x .
11 . x . . x
1 . . x . .
and 1 1 1
1 1 1 2 1
2 x x . . .
2 . . x x .
11 . x . x .
11 x . . . x
1 . . x . .
(found these with an SMT solver :D)I'm a little underwater handling the surge of traffic to my game, though when I get a quiet moment I'll run my solver so I can give some more precise answers. Basically my solver iterates over every row and column, marking cells that must be empty and painting cells that must be filled by going over every possible configuration for that row or column and finding the overlap. It does this in multiple passes and generally the more passes it takes, the more challenging the puzzle is. If it makes a pass and is unable to mark or paint any additional cells, then it considers the puzzle to be invalid if the end state is not solved (all clues are not satisfied).
I do find this discussion really interesting. Maybe I should have reserved "Section 666" for these puzzles with unique solution but require a branching strategy :).
I think one thing missing from my 5x5 puzzle thing is that good nonograms are not just those that have a unique solution and require no guessing, but also create a compelling image when the puzzle is complete. My game, Pixelogic, features user-submitted puzzles in addition to in-house ones, and I'm often blown away how creative the pixel art creations are given the constraints of solvability under my game's standards and just on and off pixels.
I wrote about what makes a good nonogram puzzle (in my opinion) in my weekly nonogram newsletter, if anyone is interested: https://weekly.pixelogic.app/p/pixelogic-weekly-4
This is OEIS sequence A242876 — https://oeis.org/A242876
okayestjoel (below) wrote:
> My nonogram solver goes over every possible configuration for each row and column based on the clues, and either fills in squares that must be filled (all possibilities overlap) or marks squares that must be empty. So if the solver reaches a point where there is ambiguity about what the next move is, then it is deemed not solvable (without guessing).
It would be (mildly) interesting to see an example of one of the 333064 solvable 5x5 nonograms that cannot be solved by okayestjoel's solver's heuristics.