diff options
Diffstat (limited to 'cell.h')
-rw-r--r-- | cell.h | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 */ |