Initial, probably buggy, load of a literate python program.
Comments are moderated. It may take a few minutes before your comment appears.
Markdown is supported in your comments.
As more rows are known, more columns are constrained (and vice versa). By looking at the entries perpendicular to the row/col of interest, we can tell if the locations are known to be zero, one or unknown. cross_row() returns this summary. With the board key as input, the output is a list of tuples. Each tuple holds a row/col number and either a one or a zero. No tuple is generated for unknown positions.