summaryrefslogtreecommitdiff
path: root/src/sudoku.h
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-09-30 11:43:36 +0000
committerStijn Buys <ingar@osirion.org>2012-09-30 11:43:36 +0000
commit44006abac0169346d67a6de31f6fe0793ead0a09 (patch)
treeec691aa1beba65559849de3a0690600e8773df7c /src/sudoku.h
parent4a529901ad6ce3d4d4c53b68dde56f8b698661a8 (diff)
Added validity test, API cleanup.
Diffstat (limited to 'src/sudoku.h')
-rw-r--r--src/sudoku.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/sudoku.h b/src/sudoku.h
index ae205b6..57dcf57 100644
--- a/src/sudoku.h
+++ b/src/sudoku.h
@@ -15,14 +15,13 @@ public:
int compare_and_assign(const Sudoku & other);
- inline int value(int row, int column) const {
- return sudoku_cell[row][column].value();
- }
-
- void set_value(int row, int column, int cell_value);
-
void reset();
+ bool validate();
+
+ /**
+ * @brief reset solution space of the given cell
+ * */
void reset_cell(int pos_row, int pos_column);
int solve_constraints(int pos_row, int pos_column);
@@ -31,6 +30,15 @@ public:
int solve_coverage();
+ inline Cell & cell (int row, int column)
+ {
+ return sudoku_cell[row][column];
+ }
+
+ inline const Cell & cell(int row, int column) const
+ {
+ return sudoku_cell[row][column];
+ }
private:
Cell sudoku_cell[9][9];
};