<< sudoku_writegivens Read/Write sudoku_writess >>

Sudoku Toolbox >> Read/Write > sudoku_writesdk

sudoku_writesdk

Returns the given sudoku as a sdk string.

Calling Sequence

str = sudoku_writesdk ( X )
str = sudoku_writesdk ( X , filename )

Parameters

X:

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

filename, optional:

a string representing a file

str:

a 9x9 matrix of characters, with dots "." for unknowns. The entries come row by row.

Description

Converts a sudoku in matrix form into a sdk string, where "." represents unknowns. If the input argument filename is present, also writes the string into the file.

Examples

X = [
0 0 0   0 0 0   0 0 0
0 0 0   0 0 0   5 3 0
9 0 0   0 3 7   0 0 0
0 0 2   3 0 1   0 9 6
0 4 7   6 9 0   1 8 0
0 0 6   7 8 5   0 0 0
0 5 0   0 2 0   9 0 3
0 3 0   9 0 0   6 0 8
8 0 0   0 1 0   4 7 0
]
sudoku_writesdk ( X )
sudoku_writesdk ( X , TMPDIR+"/foo.sdk" )

See also

Authors

Bibliography

http://www.sudocue.net/fileformats.php


<< sudoku_writegivens Read/Write sudoku_writess >>