summaryrefslogtreecommitdiff
path: root/cell.h
diff options
context:
space:
mode:
Diffstat (limited to 'cell.h')
-rw-r--r--cell.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/cell.h b/cell.h
index fc5f467..7041920 100644
--- a/cell.h
+++ b/cell.h
@@ -1,6 +1,10 @@
#ifndef SUDOKU_CELL_H
#define SUDOKU_CELL_H
+#define CELL_VALUE_MASK(x) (1 << ((x)-1))
+#define CELL_SET_NOT(target, val) ((target) |= CELL_VALUE_MASK(val))
+#define CELL_IS_NOT(cand, val) ((cand & CELL_VALUE_MASK(val)))
+
/* Description of a single cell on a sudoku board */
struct cell
{
@@ -10,7 +14,7 @@ struct cell
/* Array used to determine which values this cell can NOT be.
* A non-zero value at index N indicates that this cell cannot have the
* value N + 1 */
- char not[9];
+ int not;
};
#endif /* SUDOKU_CELL_H */