swipl -s sudoku.pl
start.
Then follow instructions
# one cell missing
[
[1,2,3,4,5,6,7,8,9],
[4,5,6,7,8,9,1,2,3],
[7,8,9,1,2,3,4,5,6],
[2,1,4,3,6,5,8,9,7],
[3,6,5,8,9,7,2,1,4],
[8,9,7,2,1,4,3,6,5],
[5,3,1,6,4,2,9,7,8],
[6,4,2,9,7,8,5,3,1],
[9,7,8,5,3,1,6,4,0]
].
# all zeros
[
[0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0]
].
# Example NYT Sudoku from April 5, 2024
[
[0,3,0,5,6,0,0,7,0],
[9,0,0,0,0,0,0,5,0],
[0,6,0,8,2,0,0,0,9],
[1,0,0,0,0,0,0,0,0],
[0,0,0,0,9,2,8,0,0],
[0,0,0,0,0,8,0,9,7],
[0,0,7,0,5,0,0,3,2],
[5,0,0,3,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0]
].
# Invalid puzzle
[
[3,3,0,5,6,0,0,7,0],
[9,0,0,0,0,0,0,5,0],
[0,6,0,8,2,0,0,0,9],
[1,0,0,0,0,0,0,0,0],
[0,0,0,0,9,2,8,0,0],
[0,0,0,0,0,8,0,9,7],
[0,0,7,0,5,0,0,3,2],
[5,0,0,3,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0]
].