You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
647 B

sudoku(Puzzle, Solution) :-
Solution = Puzzle,
Puzzle = [A1, A2, A3, A4,
B1, B2, B3, B4,
C1, C2, C3, C4,
D1, D2, D3, D4],
fd_domain(Puzzle, 1, 4),
fd_all_different([A1, A2, A3, A4]),
fd_all_different([B1, B2, B3, B4]),
fd_all_different([C1, C2, C3, C4]),
fd_all_different([D1, D2, D3, D4]),
fd_all_different([A1, B1, C1, D1]),
fd_all_different([A2, B2, C2, D2]),
fd_all_different([A3, B3, C3, D3]),
fd_all_different([A4, B4, C4, D4]),
fd_all_different([A1, A2, B1, B2]),
fd_all_different([A3, A4, B3, B4]),
fd_all_different([C1, C2, D1, D2]),
fd_all_different([C3, C4, D3, D4]).