A program for solving grid logic puzzles while printing out its reasoning.
The program is based on Escamocher and O’Sullivan’s paper Solving Logic Grid Puzzles with an Algorithm that Imitates Human Behavior, with some modifications.
Here’s the output when solving the example provided in the paper:
-
The person from the “United States” was born in “1946”.
-
“Leo” is younger than the person from “Germany”.
-
“Donald” was born in “1946”, or he is from “Ireland”.
See the solution in the web interface here.
Or with the CLI, ./gridsolve puzzles/simple.txt
:
+------------+---------------+---------------+ | First Name | Country | Year of Birth | +------------+---------------+---------------+ | Angela | Germany | 1954 | +------------+---------------+---------------+ | Donald | United States | 1946 | +------------+---------------+---------------+ | Leo | Ireland | 1979 | +------------+---------------+---------------+