Limited Reasoner Demo: Sudoku

Quick start: choose a "Game Configuration", hit the "Click me!" button, and see the agent play under "Game Output".

For further demos and details on the reasoner, click here.

Game Configuration

Sudoku game:

Max. number of case splits:

Game Output

Quick explanation: The agent attempts to complete the field so that every row, column, and 3×3 box contains exactly one 1, 2, 3, 4, 5, 6, 7, 8, 9.

See previous / next turn (or use arrow keys ⇦ ⇨).

About Sudoku

The field must be completed so that every row, column, and 3×3 box contains exactly one 1, 2, 3, 4, 5, 6, 7, 8, 9. There is only one correct solution.

About the Agent

The agent is a simple C++ program that loops over all cells and uses the reasoner to find out which cells are known to contain a number 1, ..., 9.

There are two simple types of constraints to represent the game rules. Firstly, constraints of the form val(X,Y) ≠ val(X',Y') for certain values X, X', Y, Y' from 1, ..., 9 stipulate that in no row, column, or 3×3 box any number occurs twice. Secondly, for every cell X, Ythere is a constraint val(X,Y) = 1 ∨ val(X,Y) = 2 ∨ ... ∨ val(X,Y) = 9 to indicate that its value is a number 1, ..., 9.

On every turn, the agent checks for every cell and every value 1, ..., 9 whether the cell is known to take this value. This process is repeated for increasing split level, until a known value is found for a cell: first for split level 0, then for 1, ..., until the maximum specified split level. If no value is found for any cell, the agent admits defeat and stops.

Note the agent's actions are not represented in the knowledge base – it's just hard-coded in C++. Extending the knowledge base to a basic action theory that also represents the agent's actions would be the next step.

The runtime reported by the game refers to the time the agent actually spend playing. The actual time that passes between starting and finishing the game may be longer because the graphical display procedures take some time. (To be precise, the browser takes a 10 ms break between moves to remain responsive.)