Sudoku solver

It’s pretty straightforward to make a Sudoku solver in Prolog especially when applying CLP (Constraint Logic Programming).

Here is how to use my program:

Then you can enter the known numbers one by one.

When complete, the program determines and prints the solution.

Typing

Gives

By pressing ; over and over again, you could enumerate all 6,670,903,752,021,072,936,960 possible Sudoku solution grids, but this might take a while..

It shouldn’t be too hard to extend this program to actually create new puzzles. If anyone does, let me know.

The prolog environment I used here is SWI-Prolog.