-
Notifications
You must be signed in to change notification settings - Fork 0
/
ENCODING.txt
31 lines (27 loc) · 1.44 KB
/
ENCODING.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
LOG FILES
---------
Lines contain up to 80 characters. Lines starting with a hash character ('#')
are comments or metadata and should be ignored. Other lines contain
space-separated moves in standard format, in the order they are played.
STATE DESCRIPTION
-----------------
A state is described as a sequence of 50 digits in base 62, which are encoded
with characters from the following 62-character sequence:
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
(This is a standard Base64 encoding without the two non-standard characters.)
Digit 0 is encoded as 2*game_phase + next_player, where:
game_phase = 0 when placing pieces, 1 when stacking pieces, 2 when finished.
next_player = 0 for white, 1 for black.
Digit 1 through 49 describe the fields of the board in row-major order, one
digit per field, with each field encoded as:
0 if it is empty;
1 if it contains just a Dvonn piece;
n otherwise, where n = 4*pieces + 2*dvonn + player - 2, where:
player: 0 for white or 1 for black;
dvonn: 0 if the stack contains no Dvonn piece, 1 otherwise;
pieces = the number of pieces in the stack.
Note that `dvonn' is 1 even if the stack contains more than one Dvonn piece and
`pieces' is the total number of pieces in the stack (including white, black and
Dvonn pieces). This encoding limits stacks to a maximum height of 15, which is
insufficient for all possible states, but states with very high stacks occur
rarely in practice.