MCPcopy Create free account
hub / github.com/NVIDIA/stdexec / valid_board

Function valid_board

examples/sudoku.cpp:201–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201bool valid_board(board_element *b)
202{
203 bool success = true;
204 for (unsigned i = 0; i < BOARD_SIZE; ++i)
205 {
206 if (success && b[i].solved_element)
207 { // element is fixed
208 unsigned row = i / BOARD_DIM, col = i % BOARD_DIM;
209 if (in_row(b, row, col, b[i].solved_element) || in_col(b, row, col, b[i].solved_element)
210 || in_block(b, row, col, b[i].solved_element))
211 success = false;
212 }
213 }
214 return success;
215}
216
217bool examine_potentials(board_element *b, bool *progress)
218{

Callers 1

examine_potentialsFunction · 0.85

Calls 3

in_rowFunction · 0.85
in_colFunction · 0.85
in_blockFunction · 0.85

Tested by

no test coverage detected