file formats

The following formats are accepted for input and most may be selected for output:  
These are described below.

Python list format

The data is on a single line and is enclosed within square braces. Each row of the grid is represented by a string of numbers enclosed within single or double quotes. Numbers above 9 must be represented by a letter: a = 10, b = 11, c = 12, d = 13, e = 14, f = 15
eg
['1020', '2010', '0240', '0000']

Comma separated value format (csv)

One line of data for each row of the grid, with the values separated by commas. Numbers above nine are written as ordinary two digit numbers. This format can be read and written by almost all spreadsheet programs and is useful for exchanging data with other applications.
eg
 6, 3, 2, 1, 5, 8, 7, 4, 9
 4, 9, 5, 2, 7, 6, 8, 3, 1
 8, 7, 1, 4, 3, 9, 5, 6, 2
 5, 1, 7, 8, 4, 2, 3, 9, 6
 3, 4, 6, 5, 9, 7, 2, 1, 8
 2, 8, 9, 3, 6, 1, 4, 5, 7
 1, 5, 8, 6, 2, 4, 9, 7, 3
 7, 6, 4, 9, 8, 3, 1, 2, 5
 9, 2, 3, 7, 1, 5, 6, 8, 4

Single line of data

This format is more suitable for smaller grids, but may be used for any size. The data is given as a list of digits, one for each cell, without any punctuation or spacing. If numbers above 9 are used they must be represented by letters: a = 10, b = 11, c = 12, d = 13, e = 14, f = 15
eg
1020201002400000

Xml format

This is the only format which can store and retrieve lists of candidate values for the cells, as well as the known values. It will usually be easier to enter the values into the application, and use the program to write out a file. But data files can be written by hand if desired.

In the example below, the following points are worth noting:


eg
<?xml version="1.0" ?>
<sudoku>
<size cols="4" rows="4"/>
<cell col="1" row="1" value="1"/>
<cell col="2" row="1" value="0">
    <candidate value="2"/>
    <candidate value="3"/>
</cell>
<cell col="3" row="1" value="0">
    <candidate value="3"/>
</cell>
<cell col="4" row="1" value="4"/>
<cell col="1" row="2" value="0">
    <candidate value="3"/>
</cell>
<cell col="2" row="2" value="0">
    <candidate value="3"/>
    <candidate value="4"/>
</cell>
<cell col="3" row="2" value="0">
    <candidate value="1"/>
    <candidate value="3"/>
</cell>
<cell col="4" row="2" value="2"/>
<cell col="1" row="3" value="0">
    <candidate value="2"/>
    <candidate value="3"/>
</cell>
<cell col="2" row="3" value="1"/>
<cell col="3" row="3" value="0">
    <candidate value="2"/>
    <candidate value="3"/>
    <candidate value="4"/>
</cell>
<cell col="4" row="3" value="0">
    <candidate value="3"/>
</cell>
<cell col="1" row="4" value="4"/>
<cell col="2" row="4" value="0">
    <candidate value="2"/>
    <candidate value="3"/>
</cell>
<cell col="3" row="4" value="0">
    <candidate value="1"/>
    <candidate value="2"/>
    <candidate value="3"/>
</cell>
<cell col="4" row="4" value="0">
    <candidate value="1"/>
    <candidate value="3"/>
</cell>
</sudoku>