A picross solver? That's interesting... I'd be curious to hear about the details. Are they public?
Unfortunately, I'm 99% sure it won't. You really have to find the handle and release it. :/
I'm interested in this too. Probably a lot of dynamic programming and base case and build stuff.
What sort of algorithm did you use?
The test was split into seven stages with increasing difficulty. In level 1, for instance, there was just a single row with a single block to solve. In level 2, multiple blocks were allowed. Level 3 introduced multiple colors for the blocks, and in level 4 a hint with some pre-filled cells was provided together with the input data. Level 5 did not include any new requirements and just tested some edge cases. Level 6, which is where I failed, was about expanding the solver from a single row to a full Picross puzzle with an arbitrary number of rows and columns. I don't know about level 7, as the level descriptions are only unlocked after finished the previous one. But I assume it simply contains more sophisticated puzzles, analogous to level 5.
There are zero implementation requirements. You're free to use any programming language and solve the tasks however you want. The input data was provided in the form of text files (one puzzle per row), and the solution had to be entered on their website, which simply tells you whether the solution is correct or incorrect. This goes for all of their tests, by the way.
Example Input: 10 2 1 5 2 3 ?????????2
Ten columns with two blocks. The first block has length 5 and color 1, the second one has length 3 and color 2. The last argument is the hint, which states that the very last cell has the color 2.
Expected Output: ??111??222
I suppose the meaning is obvious: A number means that the cell in its position is guaranteed to have that color, while questions marks indicate that the cells' colors are ambiguous.
As for my solution:
It's actually pretty simple. For the first block, I calculate the range which the block could potentially occupy. That's simply the length of the row minus the sum of the lengths of the subsequent blocks minus one separator for each pair of blocks (only if they have the same color). Then, I calculate all potential positions for the block within this range. Finally, the same function is called recursively for the rest of the blocks (just for the rest of the row, of course). The potential positions for the first block are combined with all results from the recursive call, which in turn consist of all potential positions for the second block combined with all possible positions for the third block and so on.
Finally, all that's left to do is to evaluate the resulting list of solutions and combine them into the string format described above. For each index: If all solutions have the same value in this position, append that value to the string. Otherwise, append a question mark.
As mentioned above, the next step would have been to solve entire Picross puzzles instead of just single rows. The test's over, but I'm nonetheless gonna finish the level just for fun. My plan is to 1) call my function for each row, 2) transpose the field so the columns are now rows, and 3) simply use my function again for each of them. Level 4 already required adding support for a hint, so I can simply use the existing values in the field as the hint in order to further restrict the solutions. Then, I will just have to repeat this three step process until the result is stable.
---------
Some of the tests are publicly availably (though you need to create an account), but this Picross test is not. However, I could send you the level descriptions and the test data for the first six levels via PM.