A solver for picross puzzles