Download ScrZebra
ScrZebra is an abbreviation of SCRiptable endgame solver ZEBRA.
It is a standalone program which runs in a command window under
Windows 95/98/ME/NT/2000/XP or Linux and solves a list of positions WLD or
for exact score.
The same endgame solver as in WZebra is used.
The Othello endgame script format was devised by
Raphael Schreiber
,
Stéphane Nicolet
and
myself
and is as follows:
-
Each line not beginning with a % contains a position to solve:
First a 64-character string containing the board position, then one
or more spaces, then one character which indicates whose turn it is
to move.
The string contains the contents of the squares in row-wise order, i.e.,
a1-b1-c1-...-g8-h8.
Black discs are denoted by *, X or x, white
discs are denoted by O, 0 or o and empty positions
are denoted by - or ..
-
Each line beginning with a % is a comment. It is also allowed to have
trailing comments (beginning with a %) at the end of lines
containing positions.
As an example, consider the following minimalistic example file:
% Here's a bunch of lopsided positions
XO---XXX-OOO-OOO-OOOOOO---OOXO---OOXOOO-OOXOOOOOXXXXX---XXXXXX-- X % Comment for position 1
OOOOOOOOOOOOOOOXOXOXXXX-OOOOXX-OOOOOXX--OOXXO---OX--XO--X------- X % Do close positions exist in Othello?
XXOOOOOO-XXXXX-O-XXXXXXOOXOOXXOXOOXOXOXXOXOOOO--O-XO------------ X % Comment for position 3
---O-----OOOO---XO-OOO--XOOOOO-XXOXXXOO-XOOXXOOOOOXOXXO-OXOOOOO- X
-----------------------O--OOOOO---OOOOOXOOOOXXXX--XXOOXX--XX-O-X X
--XXXXX---XXXX---OOOXX---OOXXXX--OOXXXO-OOOOXOO----XOX----XXXXX- O % Ah! This one is closer.
% End of the endgame script
The action taken by the program when given an input file in the
above format is as follows:
-
All relevant positions are solved using an endgame solver.
An output is created which contains the same comments as the input
while but where each board position is replaced by a result string.
Possible results string:
-
Solving for exact score: <black> - <white>
<black>and <white> are the numbers of disc Black and White,
respectively, can obtain with perfect play from both sides,
starting from the position.
-
Solving for exact score, with optimal line: <black> - <white> <move string>
<black> and <white> are as above.
The <move string> must contain a partial or complete
line of play, starting from the position.
The text for a move is an actual move in lowercase (e.g. b7), or -- for a pass.
The actual length (number of moves) of the output line is implementation
dependent and can depend on current program settings like hash table size
or user parameters.
However, all moves generated must have been proven perfect, and can
not result from heuristic (approximate) endgame searches.
-
Solving WLD: [Black win | Draw | White win]
Black win if Black can force a win against perfect defense,
White win if White can force a win, Draw otherwise.
-
Solving WLD, with semi-optimal line: [Black win | Draw | White win] <move string>
Black win, Draw and White win as above.
The <move string> must contain a partial or complete
semi-optimal line of play starting from the position.
Semi-optimal means that all the moves of the winning side, if any,
are winning moves, whereas it is allowed for the losing side (if any)
to make sub-optimal moves.
In case of draw, all generated moves must be optimal.
The text for a move is an actual move in lowercase (e.g. b7), or -- for a pass.
The actual length (number of moves) of the output line is implementation
dependent and can depend on current program settings like hash table size
or user parameters.
However, all moves generated must have been proven perfect, and can
not result from heuristic (approximate) endgame searches.
-
If the comment % End of the endgame script is encountered,
all subsequent positions are ignored.
Four possible outputs corresponding to the input above are:
-
For an exact score solve:
% Here's a bunch of lopsided positions
63 - 1 % Comment for position 1
4 - 60 % Do close positions exist in Othello?
14 - 50 % Comment for position 3
49 - 15
64 - 0
35 - 29 % Ah! This one is closer.
% End of the endgame script
-
For an exact score solve with optimal line:
% Here's a bunch of lopsided positions
63 - 1 b4 a5 a4 a3 h3 -- a2 -- h5 h4 e1 c1 g4 % Comment for position 1
4 - 60 f6 h3 f8 b8 c8 g4 -- g5 -- c7 % Do close positions exist in Othello?
14 - 50 d8 h6 b7 g2 e7 a8 g7 g6 f7 b8 c8 % Comment for position 3
49 - 15 b1 a2 c3 -- h8 h7 f1 f2
64 - 0 g8 e8 h4 b7 g3 b8 h2 -- f3 f2 a8 -- a7 -- a5 -- f1 g2 e2 d2 d1 -- c2 b2 b5 b4 e1 -- h1
35 - 29 g2 h1 c2 g1 f1 d2 b2 a2 b6 c6 b5 % Ah! This one is closer.
% End of the endgame script
-
For a WLD solve:
% Here's a bunch of lopsided positions
Black win % Comment for position 1
White win % Do close positions exist in Othello?
White win % Comment for position 3
Black win
Black win
Black win % Ah! This one is closer.
% End of the endgame script
-
For a WLD solve with semi-optimal line:
(Note the semi-optimal line containing sub-optimal moves for position 4.)
% Here's a bunch of lopsided positions
Black win b4 % Comment for position 1
White win f6 h3 f8 % Do close positions exist in Othello?
White win d8 h6 b7 % Comment for position 3
Black win g2 f2 b1 c3 g3 a2 h8 h7 h5 h1 f1 g4 g1 e1 a1 c1 -- h2 h3
Black win g8 e8 h4
Black win g2 % Ah! This one is closer.
% End of the endgame script
To run scrZebra, download the Windows or Linux archive below and unpack
it into a directory which contains the file coeffs2.bin
which you either can download separately
here
or copy from the WZebra directory if you already have
downloaded WZebra 2.0 or higher from
this page.
Name | Size | Last changed | Contents |
scrz.zip
|
165kB
|
October 2, 2006
|
Windows
|
scrzl.tar.gz
|
320kB
|
January 3, 2003
|
Linux
|
The archive contains the following files:
Name | Contents |
scrzebra.exe | The solver. |
ffotest.scr | Script file for the
FFO test. |
Note: The latest scrZebra uses MMX instructions and hence does
not run on the oldest Pentium processors.
scrZebra is run from a command window and the syntax is as follows:
scrzebra [-e <echo output?>]
[-h <hash size>]
[-wld <wld only>]
[-line <store line?>]
[-b <use opening book?>]
-script <input script> <output file>
The basic mode of operation, solving a set of positions for exact score,
can be performed as follows:
scrzebra -script mygames.scr mygames.out
The command-line options can be given in any order and
are interpreted as follows:
-
-e <echo Zebra output?> optional
-
This switch controls if the board positions and Zebra's intermediate
results are output when the script is analyzed; -e 1 (default) enables
output while -e 0 disables it.
-
-h <hash table size> optional
-
The number of bytes in the hash table is 16*2^N if -h N is given.
Default is N=18, i.e., a 4MB hash table.
-
-wld <wld only?> optional
-
This switch toggles if the positions are solved WLD or for exact score;
-wld 0 (default) gives exact score while -wld 1 gives WLD only.
-
-line <store line?> optional
-
This switches toggles if optimal (when solving for exact score) or
semi-optimal (when solving WLD) lines are written to the output
file as described below.
-line 1 enables this mode of operation while -line 0 (default)
disables it.
-
-b <use opening book?> optional
-
This switches specifies if the opening book file book.bin will be
read and its contents used when solving. Default is not to read the
book file, corresponding to -b 0, while -b 1 enables
use of the book.
-
-script <input script> <output file>
-
This mandatory switch specifies the script containing positions
to solve and the output file to which the results are written.
Legal stuff
The program is freeware and may be copied freely as long
as no modifications are made.
It may not be used for any commercial purposes without
the explicit consent of its creator.
Last modified October 2, 2006 by
Gunnar Andersson
gunnar@radagast.se