Author Topic: How to create a Puzzle Pack  (Read 5537 times)

0 Members and 1 Guest are viewing this topic.

Offline David

  • Administrator
  • *****
  • Posts: 314
  • Karma: 10
    • View Profile
    • http://www.smoresoft.com/
How to create a Puzzle Pack
« on: May 02, 2006, 07:13:03 AM »
About Puzzle Packs
Smoresoft Sudoku supports "puzzle pack" files that contain one or more Sudoku puzzle grids. Puzzle packs can be created by anyone using a simple text editor.

Using a Puzzle Pack
To use a puzzle pack, choose the "Open..." menu item and select a puzzle pack from the list. Smoresoft Sudoku will then display the first puzzle in the puzzle pack, or if you have played the puzzle pack before, the last puzzle you played in the puzzle pack will be displayed.

Creating a Puzzle Pack
A puzzle pack is an XML document that contains one or more coded puzzles. Following is an example of a puzzle pack containing two Sudoku puzzle grids:

Code: [Select]
1. <?xml version="1.0" encoding="utf-8"?>
2. <puzzlePack>
3.    <puzzles rating="1">
4.       <puzzle>...475....67...54..513.682.6..829..13.4...9.88..643..2.437.219..82...37....531...</puzzle>
5.       <puzzle>7.9....4.......813...516.......7.291...321...421.5.......295...162.......3....4.8</puzzle>
6.    </puzzles>
7. </puzzlePack>
(Line numbers are added to help explain the example.)

Line 1 is an XML declaration, which indicates that the following content is XML.

Line 2 is the puzzlePack element. This indicates that the following XML content represents a puzzle pack.

Line 3 is the puzzles element. It indicates that the following XML content represents a set of puzzles. The puzzles element also contains a rating attribute. This attribute indicates the difficulty level of the following puzzles (see the Rating section).

Lines 4-5 contain puzzle elements. Each puzzle element is followed by a coded puzzle (as explained in the Puzzle Coding section below) and an ending puzzle element. A puzzle pack MUST contain one or more puzzle elements.

Line 6 contains the end of the puzzles element started on line 3.

Line 7 contains the end of the puzzlePack element started on line 2.

Puzzle Coding
Sudoku puzzle grids are coded on a single line using a single character per cell, beginning with the top left cell of the grid and progressing first from left to right and then from top to bottom, for a total of 81 characters (9 columns x 9 rows).

Cells with "given" or "clue" values are entered as a single digit (1-9), and empty cells are entered as a "." (period).

So, for example, the puzzle below is coded as "...475....67...54..513.682.6..829..13.4...9.88..643..2.437.219..82...37....531...".



Puzzle Rating
Sudoku puzzle rating is not standardized and varies significantly by publisher. If anyone has information about a puzzle rating standard, please reply to this topic with details.

For the time being, selection of the rating is left to the puzzle pack publisher, except to say that the rating value in quotes should be an integer in the range 1 (easiest) to 10 (most difficult).

Puzzle Pack Naming
Puzzle packs MUST use the file extension "spp". Also, puzzle pack file names should contain a description of the difficulty of the puzzles contained in the puzzle pack. For example, "Smoresoft-Easy.spp" would be an appropriate name for a puzzle pack created by Smoresoft and containing easy puzzles.

Recommendations
Since Smoresoft Sudoku does not currently allow difficulty levels to be selected in the game, it is suggested that a puzzle pack contain only puzzles with a single difficulty level.

Distribution
The simplest methods of distributing a puzzle pack would be either publishing the puzzle pack unchanged or in a compressed archive, such as a zip file. However, this requires the user to have quite a bit of knowledge in order to install the puzzle pack on their device, especially if they wish to download it directly from the device.

Instead, it is recommended that the puzzle pack be distributed in a compressed CAB file which can be easily installed on the device.

Future
Additional elements will be supported and displayed in-game by Smoresoft Sudoku to identify puzzles and credit the authors and publishers. Elements will be based on RDF/XML and Dublin Core.
« Last Edit: June 05, 2006, 08:58:07 PM by David »