A solver for nonogram puzzles