it\'s Friday afternoon, let\'s have a fun puzzle/algorithm problem to solve.
One of my favorite Nintendo DS games is Picross DS. The game is quite simple, it involves so
I don't have enough time right now to flesh out a solution, but this is how I would tackle it.
"function1" determine the possible combinations for a row or column given the constraints of the numbers on the top or side, and the squares that are already filled out and those that have been emptied.
"function2" take the output from function1 and logically and all the results together - the spots with ones could be filled in.
"function3" take the output from function1 and logically or all the results together - the spots with zeros could be emptied.
keep applying function2 and function3 to all the rows and collumns until no more boxes are emptied or filled in. If the puzzle is solved then, you are done.
If the puzzle is not solved, then take a row or column that has the fewest possibilities and apply the first possibility. Then apply function2 and function3 to the new board. If it leads to a contradiction (0 possibilities for a row or column) then un-apply the possibility and try a different one. Keep recursing like this until a solution is found.