#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 { /* Sovled value of this cell */ char val; /* 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 */ int not; }; #endif /* SUDOKU_CELL_H */