<< sudoku_findxcycle Algorithms sudoku_iscandsingle >>

Sudoku Toolbox >> Algorithms > sudoku_findxwing

sudoku_findxwing

Find X-Wings.

Calling Sequence

[X,C,L] = sudoku_findxwing ( X , C , L )
[X,C,L] = sudoku_findxwing ( X , C , L , stopatfirst )
[X,C,L] = sudoku_findxwing ( X , C , L , stopatfirst , verbose )

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

stopatfirst:

if %t, then stop after one or more candidates have been removed. (default = %t)

verbose:

a boolean. Set to %t to display the state of the matrix. (default = %f)

Description

Search for x-wings.

Examples

X = [
0 0 0   1 3 0   0 0 5
0 4 0   0 0 0   2 0 0
8 0 0   9 0 0   0 0 0
..
0 0 0   0 5 0   9 0 0
0 0 2   0 0 0   4 0 0
0 0 3   0 6 0   0 0 0
..
0 0 0   0 0 3   0 0 6
0 0 5   0 0 0   0 1 0
7 0 0   0 2 8   0 0 0
];
[C,L] = sudoku_candidates(X);
sudoku_findxwing ( X , C , L , %f , %t );

Authors

Bibliography

http://www.sadmansoftware.com/sudoku/xwing.htm

<< sudoku_findxcycle Algorithms sudoku_iscandsingle >>