summaryrefslogtreecommitdiff
path: root/src/sudoku.h
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2013-04-26 20:12:25 +0000
committerStijn Buys <ingar@osirion.org>2013-04-26 20:12:25 +0000
commitc93587b39b34c38f7d788fc639ced2bf5493a56a (patch)
tree1d377e2a05945a7f7cd47fca91b53ee00e32441f /src/sudoku.h
parent1bdd9ddbfdd021284201bd0a1f5da41be3dc9578 (diff)
Added brute-force search algorithm.
Diffstat (limited to 'src/sudoku.h')
-rw-r--r--src/sudoku.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/sudoku.h b/src/sudoku.h
index 0aa8395..394f165 100644
--- a/src/sudoku.h
+++ b/src/sudoku.h
@@ -19,6 +19,8 @@ public:
bool validate();
+ bool solved();
+
/**
* @brief reset solution space of the given cell
* */
@@ -30,7 +32,15 @@ public:
int solve_coverage();
- int solve();
+ /**
+ * @brief solve the sudoku, using constraint and converage rules only
+ * */
+ int solve_rules();
+
+ /**
+ * @brief solve the sudoku, using exhaustive search
+ * */
+ int solve_search();
inline Cell & cell (int row, int column)
{
@@ -42,6 +52,8 @@ public:
return sudoku_cell[row][column];
}
private:
+ bool solve_search_step(int &iterations, Sudoku & solution);
+
Cell sudoku_cell[9][9];
};