<< sudoku_visiblefrom Algorithms Generate >>

Sudoku Toolbox >> Algorithms > sudoku_visiblefrom2

sudoku_visiblefrom2

Compute the cells visible from both cell a and b.

Calling Sequence

V = sudoku_isvisiblefrom2 ( a , b )

Parameters

a:

a 1x2 matrix, where a(1) is a row index and a(2) is a column index

b:

a 1x2 matrix, where b(1) is a row index and b(2) is a column index

V:

a 9x9 boolean matrix. V(i,j) is true if the cell (i,j) is visible from both cell a and cell b.

Description

Returns the matrix of cells which are visible from both the cells a and b. The cell p is visible from both cell a and b if : * a and b are in the same row and p is on this row, * a and b are in the same column and p is on this column, * p in the same row as a and on the same column as b, * p in the same column as a and on the same row as b, * p in the same box as a and on the same row as b, * p in the same box as a and on the same column as b, * p in the same row as a and on the same box as b, * p in the same column as a and on the same box as b, * p in the same box as a and b.

Examples

V = sudoku_visiblefrom ( [1 2] , [2 3] ); sudoku_print(V)

Authors

<< sudoku_visiblefrom Algorithms Generate >>