Remove validity check from update()
This commit is contained in:
parent
f7d132397f
commit
3d7a40cc58
6
sud.c
6
sud.c
@ -116,12 +116,6 @@ enum update_res update(struct sudoku *sud, unsigned r, unsigned c, unsigned val)
|
|||||||
unsigned tr, tc;
|
unsigned tr, tc;
|
||||||
assert(val < NDIGITS);
|
assert(val < NDIGITS);
|
||||||
|
|
||||||
/* Check that the cell is undetermined and the value is allowed. */
|
|
||||||
if (sud->cells[r][c].det)
|
|
||||||
return ALREADY_DET;
|
|
||||||
if (!sud->cells[r][c].pvals[val])
|
|
||||||
return NOT_ALLOWED;
|
|
||||||
|
|
||||||
/* Update possible values of cells in same column. */
|
/* Update possible values of cells in same column. */
|
||||||
for (tr = 0; tr < NDIGITS; ++tr) {
|
for (tr = 0; tr < NDIGITS; ++tr) {
|
||||||
if (tr == r || sud->cells[tr][c].det)
|
if (tr == r || sud->cells[tr][c].det)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user