Sudoku Clipboard and File Formats
Sharing Puzzles
The formats documented below are to facilitate sharing puzzles, or puzzle collections between computer programs. The sharing can either be done through the clipboard, or a file.
Simple Print Formats
Typically if you copy the current puzzle to the clip board and paste it into a simple text edition like Notepad you'll get information like the following. Both of these were output from Simple Sudoku.
Puzzle
*-----------* |.3.|4..|...| |9.2|8.6|3.1| |...|...|.2.| |---+---+---| |8..|.6.|7..| |.6.|2.5|.9.| |..3|.4.|..8| |---+---+---| |.7.|...|...| |4.8|9.2|5.6| |...|..8|.3.| *-----------* Simple Sudoku Version 4.2n
Candidate Grid
*--------------------------------------------------------------------* | 1567 3 1567 | 4 12579 179 | 689 5678 579 | | 9 45 2 | 8 57 6 | 3 457 1 | | 1567 1458 14567 | 1357 13579 1379 | 4689 2 4579 | |----------------------+----------------------+----------------------| | 8 12459 1459 | 13 6 139 | 7 145 2345 | | 17 6 147 | 2 1378 5 | 14 9 34 | | 1257 1259 3 | 17 4 179 | 126 156 8 | |----------------------+----------------------+----------------------| | 12356 7 1569 | 1356 135 134 | 12489 148 249 | | 4 1 8 | 9 137 2 | 5 17 6 | | 1256 1259 1569 | 1567 157 8 | 1249 3 2479 | *--------------------------------------------------------------------* Simple Sudoku Version 4.2n
Clipboard and File formats
Various Sudoku programs have created various formats for the clipboard and for storing puzzles to disk.
Simple Line Format For The Clipboard and Files
Both for the clipboard and as one puzzle per file the following one line format is recognized.
- If there are 81 groups of digits, the data is interpreted as a candidate grid. All formatting is ignored.
- If there are N digits and 81-N occurrences of another character, this character will be interpreted as representing an empty cell. When multiple characters add up to 81, the following preference list is used: '0', '.', 'X', '*', '_', ' '
Puzzle files generally don't manipulate the 81 characters representing the data. However files of solution grids are typically put into line minlex form.
- External links
- REPLY: A plea to Sudoku programmers -- standardized puzzle format in Programmers Forum by Ruud Wed Aug 23, 2006 8:57 pm
VBForums Contest format (*.msk;*.sol)
Each row in its own line, separated by CRLF.
......... ......... ......... ......... ......... ......... ......... ......... .........
- External links
- Sudoku file formats in Programmers Forum by Merri Sun Aug 14, 2005 3:56 pm
SadMan Software Sudoku format (*.sdk)
Version 1 ?!?
Like the VBForums format, but optionally starts with "[Puzzle]" and a CRLF. Each file contains a single puzzle. Additional information, such as the current state, pencil marks and any colours, may also be present.
[Puzzle] ......... ......... ......... ......... ......... ......... ......... ......... .........
- External links
- * Sudoku file formats in Programmers Forum by Merri Sun Aug 14, 2005 3:56 pm
- * SadMan Sudoku - SDK File Format @ www.sadmansoftware.com
Version 2 ?!?
The file contains 9 lines, reach representing a row in the puzzle. Empty cells are represented by a dot. Additional information is optionally present in separate lines, starting with a hash character, followed by a single letter that identifies the type of info:
* A = Author * D = Description * C = Comment * B = Date published * S = Source (name of newspaper, book or website) * L = Level * U = Source URL * N = number of solutions * H = number of clues
An example:
#ARuud #DA random puzzle created by SudoCue #CJust start plugging in the numbers #B03-08-2006 #SSudoCue #LEasy #Uhttp://www.sudocue.net/ 2..1.5..3 .54...71. .1.2.3.8. 6.28.73.4 ......... 1.53.98.6 .2.7.1.6. .81...24. 7..4.2..1
- External links
- SudoCue - File Formats @ www.sudocue.net
- SadMan Sudoku - SDK File Format @ www.sadmansoftware.com
Sudoku Puzzle Collection (.sdm)
Basically like *.txt format.
This is a very simple format. Each line contains a single puzzle. The empty cells are represented by a zero, but the program also accepts other placeholders, like a dot “.”. Line breaks in Windows or Unix style are recognized, but when my software writes these files, CrLf is always used. These files cannot be written by SudoCue. The program can only read them.
016400000200009000400000062070230100100000003003087040960000005000800007000006820 049008605003007000000000030000400800060815020001009000010000000000600400804500390 760500000000060008000000403200400800080000030005001007809000000600010000000003041 000605000003020800045090270500000001062000540400000007098060450006040700000203000 409000705000010000006207800200000009003704200800000004002801500000060000905000406 000010030040070501002008006680000003000302000300000045200500800801040020090020000 080070030260050018000000400000602000390010086000709000004000800810040052050090070 000093006000800900020006100000080053006000200370050000002500040001009000700130000
- External links
- SudoCue - File Formats @ www.sudocue.net
SuDoku Solver format (*.spf)
Like the Simple Sudoku format below, but each character is surrounded by a space and collision point of | and - is marked with a +.
. . . | . . . | . . . . . . | . . . | . . . . . . | . . . | . . . -------+-------+------ . . . | . . . | . . . . . . | . . . | . . . . . . | . . . | . . . -------+-------+------ . . . | . . . | . . . . . . | . . . | . . . . . . | . . . | . . .
- External links
- Sudoku file formats in Programmers Forum by Merri Sun Aug 14, 2005 3:56 pm
Simple Sudoku format (*.ss)
Current format is defined by the characteristic below.
- Both the top and bottom lines start and end with an asterisk ("*"), followed by dashes ("-").
- Box columns separated by |,
- Box rows separated by -,
- Each line separated by a CRLF.
*-----------* |...|...|...| |...|...|...| |...|...|...| |---+---+---| |...|...|...| |...|...|...| |...|...|...| |---+---+---| |...|...|...| |...|...|...| |...|...|...| *-----------*
Another variation that has been observed on forums is to add 9 extra spaces (and necessary dashes) to get a puzzle which is more square. Some programs will accept this file from the clipboard and some won't.
*-----------------------* | . 3 . | 4 . . | . . . | | 9 . 2 | 8 . 6 | 3 . 1 | | . . . | . . . | . 2 . | |-------+-------+-------| | 8 . . | . 6 . | 7 . . | | . 6 . | 2 . 5 | . 9 . | | . . 3 | . 4 . | . . 8 | |-------+-------+-------| | . 7 . | . . . | . . . | | 4 . 8 | 9 . 2 | 5 . 6 | | . . . | . . 8 | . 3 . | *-----------------------* Simple Sudoku modified with extra spaces
The old format was block columns separated by |, block rows separated by -, each line separated by a CRLF.
...|...|... ...|...|... ...|...|... ----------- ...|...|... ...|...|... ...|...|... ----------- ...|...|... ...|...|... ...|...|...
- External links
- Sudoku file formats in Programmers Forum by Merri Sun Aug 14, 2005 3:56 pm
- Re: Sudoku file formats by angusj Sat Aug 20, 2005 6:43 pm
*.txt format
The *.txt file format is a simple one line format per puzzle.
- 81 ASC-II characters on a line. N digits (1-9 typically) and 81-N occurrences of another character, this character will be interpreted as representing an empty cell. When multiple characters add up to 81, the following preference list is used: '0', '.', 'X', '*', '_', ' '
- Maybe one or more puzzles per file
- Multiple puzzles separated by CR-LF
- External links
- Sudoku file formats in Programmers Forum by Merri Sun Aug 14, 2005 3:56 pm