<< sudoku_candidatefind Algorithms sudoku_candidateremove >>

Sudoku Toolbox >> Algorithms > sudoku_candidateprint

sudoku_candidateprint

Find and print a candidate in the sudoku.

Calling Sequence

str = sudoku_candidateprint ( X , C , L , d )

Parameters

X:

a 9-by-9 matrix, with 0 for unknown entries

C:

a 9 x 9 cell of candidates

L:

the 9 x 9 matrix of number candidates

d:

the digit to find in the sudoku

rows:

the rows where the candidate is found

cols:

the columns where the candidate is found

Description

Search for the candidate d in all the nonfixed cells of the sudoku X. The search is performed by sudoku_candidatefind. Then print the cells where the candidate d appears.

Examples

X = [
4 0 0   3 9 0   0 0 2
2 6 0   0 5 8   3 9 0
5 9 3   6 0 0   1 8 0
..
1 0 0   8 6 0   0 0 9
6 0 5   9 0 0   2 0 0
0 3 9   2 4 5   0 1 6
..
0 5 6   0 0 9   0 2 0
0 1 4   7 0 0   9 0 5
9 0 0   5 3 0   0 0 0
];
[C,L] = sudoku_candidates(X);
[rows,cols] = sudoku_candidateprint ( X , C , L , 2 );

Authors


<< sudoku_candidatefind Algorithms sudoku_candidateremove >>