Skip to content

Documentation

Selçuk Gülcan edited this page Jul 4, 2016 · 7 revisions

Documentation

File Formats

Many object in the library can be saved as files or can be retrieved from files. This section shows the important details on how objects are stored in files.

Some important notes:

  • Any line starting with square (#) is regarded as comment. ( Placing all of comment lines at the beginning of the file is preferred)

Grid

Format:

<Comments>
<Grid Size>
<1st line of the grid>
<2nd line of the grid>
.
.
.
<nth line of the grid>

Example:

# Example 2x3 grid file
2 3
1 2 3
4 5 6

MazePuzzle

Format:

<Header>
<Start position>
<Finish position>
<# of allowed moves>
<1st allowed move>
<2nd allowed move>
.
.
<nth allowed move>
<Maze grid>

Example:

# An example Maze Puzzle
0 0
2 2
4
1 0
0 1
-1 0
0 -1
# Maze Grid
3 3
0 1 0
0 1 1
0 0 0

TangramPuzzle

Each shape is represented by Shape Form: First number represents number of corner points (m). Following m pairs show corner point coordinates. First coordinate should be (0,0)

Example:

3 0 0 6 0 3 3

Format:

<Comments>
<Final form>
<The number of component shapes>
<1st shape form>
<2nd shape form>
.
.
.
<nth shape form>

Example:

# Example Tangram Puzzle
4 0 0 8 8 8 0 0 8
4
3 0 0 8 0 8 6
3 0 0 0 4 8 6
3 0 0 0 4 4 4
3 0 0 4 4 8 4

TangramSolution

Represented by shape positions. A shape positon format is:

<# of corners> <1st corner positon> <2nd corner position> ...

Format:

<Comments>
<The number of component shapes>
<1st shape position>
<2nd shape position>
.
.
.
<nth shape position>