+=========1.4.46b================\r
+- The default persistence directory on Windows is now _PG. The names of the engine specific ini files are mangled so as not to contain spaces. \r
+- PG now tries to guess if a string option is really a file or a path (like in the Arena GUI). \r
=========1.4.45b================\r
- The engine specific config files (<myname>.ini) are now stored in a separate directory. $HOME/.polyglot on Linux and "./Polyglot Settings" on Windows. \r
- The engine specific config files are now complete config files. So they can be used in a stand alone fashion.\r
polyglot perft [-fen fen] [-max-depth depth]
DESCRIPTION
- PolyGlot as adapter and book engine
-
+ PolyGlot as adapter and book engine
PolyGlot is a "UCI adapter". It connects a GUI interface (such as
XBoard, Winboard, Arena or Chessbase) to a UCI chess engine.
NOTE: Not all options are exported, only those that make sense in the
given mode.
- Book making utilities
-
+ Book making utilities
PolyGlot supports the "PolyGlot opening book format". This is the
defacto standard non-proprietary opening book format. It is fully
documented here
Due to the possibility of transpositions this is not a fool proof
method.
- Epd test mode
-
+ Epd test mode
In epd test mode, PolyGlot will search positions in an epd file and
record the number of times the right best move was found. The
arguments specify when to stop the search in any given position.
- Perft counts
-
+ Perft counts
A perft count is the number of legal move sequence in a given position
up to a given depth. PolyGlot can perform such perft counts. It is
however much slower than other more dedicated programs.
When invoked as
- polyglot make-book
-
+ polyglot make-book
PolyGlot supports the following options
-pgn (default: "book.pgn")
When invoked as
- polyglot merge-book
-
+ polyglot merge-book
PolyGlot supports the following options
-in1
When invoked as
- polyglot dump-book
-
+ polyglot dump-book
PolyGlot supports the following options
-bin (default: book.bin)
When invoked as
- polyglot info-book
-
+ polyglot info-book
PolyGlot supports the following options
-bin (default: book.bin)
When invoked as
- polyglot epd-test
-
+ polyglot epd-test
(possibly with a config file as first argument) PolyGlot supports
besides the generic options described above the following additional
options.
When invoked as
- polyglot perft
-
+ polyglot perft
PolyGlot supports the following options
-fen (default: starting position)
comment characters # or ; in option values (such as for NalimovPath),
enclose the value in quotes.
- [PolyGlot] section
-
+ [PolyGlot] section
This section is used by PolyGlot only. The engine is unaware of these
options. The list of available options is detailed below.
Select moves according to their weights in the book. If false the
move with the highest weight is selected.
- BookRandom (default: true)
- Select moves according to their weights in the book. If false the
- move with the highest weight is selected.
+ BookLearn (default: false)
+ Store learning information in the book (which must be writable).
+ Currently no engine actually uses this information.
BookDepth (default: 256)
Stop using the book after this number of moves.
Windows)
The directory where the PersistFile is stored.
- Work arounds
-
+ Work arounds
Work arounds are identical to options except that they should be used
only when necessary. Their purpose is to try to hide problems with
various software (not just engines).
With this work around PG will send info lines at depth >=2. This
may or may not improve the display.
- [Engine] section
-
+ [Engine] section
This section contains engine UCI options. PolyGlot does not understand
them, but sends the information to the engine at startup (converted to
UCI form). You can add any UCI option that makes sense to the engine
- 2009-09-04 POLYGLOT(6)
+ 2009-09-05 POLYGLOT(6)
#define PACKAGE_NAME "polyglot"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "polyglot 1.4.45b"
+#define PACKAGE_STRING "polyglot 1.4.46b"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "polyglot"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "1.4.45b"
+#define PACKAGE_VERSION "1.4.46b"
/* Define to 1 if the C compiler supports function prototypes. */
#define PROTOTYPES 1
#define TIME_WITH_SYS_TIME 1
/* Version number of package */
-#define VERSION "1.4.45b"
+#define VERSION "1.4.46b"
/* Define like PROTOTYPES; this can be used by system headers. */
#define __PROTOTYPES 1
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for polyglot 1.4.45b.
+# Generated by GNU Autoconf 2.61 for polyglot 1.4.46b.
#
# Report bugs to <michel.vandenbergh@uhasselt.be>.
#
# Identity of this package.
PACKAGE_NAME='polyglot'
PACKAGE_TARNAME='polyglot'
-PACKAGE_VERSION='1.4.45b'
-PACKAGE_STRING='polyglot 1.4.45b'
+PACKAGE_VERSION='1.4.46b'
+PACKAGE_STRING='polyglot 1.4.46b'
PACKAGE_BUGREPORT='michel.vandenbergh@uhasselt.be'
ac_unique_file="mainloop.c"
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures polyglot 1.4.45b to adapt to many kinds of systems.
+\`configure' configures polyglot 1.4.46b to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of polyglot 1.4.45b:";;
+ short | recursive ) echo "Configuration of polyglot 1.4.46b:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-polyglot configure 1.4.45b
+polyglot configure 1.4.46b
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by polyglot $as_me 1.4.45b, which was
+It was created by polyglot $as_me 1.4.46b, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
# Define the identity of the package.
PACKAGE='polyglot'
- VERSION='1.4.45b'
+ VERSION='1.4.46b'
cat >>confdefs.h <<_ACEOF
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by polyglot $as_me 1.4.45b, which was
+This file was extended by polyglot $as_me 1.4.46b, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-polyglot config.status 1.4.45b
+polyglot config.status 1.4.46b
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
-AC_INIT([polyglot], [1.4.45b], [michel.vandenbergh@uhasselt.be])
+AC_INIT([polyglot], [1.4.46b], [michel.vandenbergh@uhasselt.be])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([mainloop.c])
AC_CONFIG_HEADER([config.h])
// constants\r
\r
\r
-static const char * const Version = "1.4.45b";\r
+static const char * const Version = "1.4.46b";\r
static const char * const HelpMessage = "\\r
SYNTAX\n\\r
* polyglot [configfile] [-noini] [-ec engine] [-ed enginedirectory] [-en enginename] [-log] [-lf logfile] [-hash value] [-bk book] [-pg <name>=<value>]* [-uci <name>=<value>]*\n\\r
"; obtained from the engine settings dialog\n"\r
"; in WinBoard/xboard 4.4.0 and higher.\n"\r
"\n" \r
+ "; If the value of the option \"Persist\" is false\n"\r
+ "; then the content of this file is ignored.\n"\r
+ "\n"\r
"; It is allowed to manually edit this file\n"\r
"; and you may safely delete it as well.\n"\r
"\n";\r
}\r
}\r
\r
-// write_ini()\r
\r
-static void write_ini(const char *filename,\r
- option_list_t *pg_options,\r
- option_list_t *uci_options){\r
+// make_ini()\r
+\r
+static void make_ini(ini_t *ini){\r
option_t *opt;\r
char tmp[StringSize];\r
- FILE *f;\r
- time_t t=time(NULL);\r
- f=fopen(filename,"w");\r
- if(!f){\r
- // alas this does nothing....\r
- gui_send(GUI,"tellusererror write_ini(): %s: %s.",filename,strerror(errno));\r
- // but at least we log the error\r
- my_log("POLYGLOT write_ini(): %s: %s.\n",filename,strerror(errno));\r
- return;\r
- }\r
- fprintf(f,"; %s\n",ctime(&t));\r
- fprintf(f,IniIntro,option_get_string(Option,"EngineName"));\r
- fprintf(f,"[PolyGlot]\n");\r
- fprintf(f,"EngineName=%s\n",\r
- option_get_string(Option,"EngineName"));\r
- fprintf(f,"EngineCommand=%s\n",\r
- option_get_string(Option,"EngineCommand"));\r
- fprintf(f,"EngineDir=%s\n",\r
- option_get_string(Option,"EngineDir"));\r
- option_start_iter(pg_options);\r
- while((opt=option_next(pg_options))){\r
+ ini_insert_ex(ini,"polyglot",\r
+ "EngineName",\r
+ option_get_string(Option,"EngineName"));\r
+ ini_insert_ex(ini,"polyglot",\r
+ "EngineCommand",\r
+ option_get_string(Option,"EngineCommand"));\r
+ ini_insert_ex(ini,"polyglot",\r
+ "EngineDir",\r
+ option_get_string(Option,"EngineDir"));\r
+ option_start_iter(Option);\r
+ while((opt=option_next(Option))){\r
if(!my_string_equal(opt->value,opt->default_)&&\r
- !IS_BUTTON(opt) &&\r
+ !IS_BUTTON(opt->type) &&\r
(opt->mode & XBOARD)){\r
- snprintf(tmp,sizeof(tmp),"%s=%s\n",opt->name,opt->value);\r
- tmp[sizeof(tmp)-1]='\0';\r
- fprintf(f,"%s",tmp);\r
+ ini_insert_ex(ini,"polyglot",opt->name,opt->value);\r
}\r
}\r
- fprintf(f,"[Engine]\n");\r
- option_start_iter(uci_options);\r
- while((opt=option_next(uci_options))){\r
+ option_start_iter(Uci->option);\r
+ while((opt=option_next(Uci->option))){\r
if(!my_string_equal(opt->value,opt->default_)&&\r
- !IS_BUTTON(opt)){\r
- snprintf(tmp,sizeof(tmp),"%s=%s\n",opt->name,opt->value);\r
- tmp[sizeof(tmp)-1]='\0';\r
- fprintf(f,"%s",tmp);\r
+ !IS_BUTTON(opt->type)){\r
+ ini_insert_ex(ini,"engine",opt->name,opt->value);\r
}\r
}\r
- fclose(f);\r
}\r
\r
-// write_ini_ex()\r
\r
-static void write_ini_ex(const char *filename,\r
+// write_ini()\r
+\r
+static void write_ini(const char *filename,\r
ini_t *ini){\r
ini_entry_t *entry;\r
char tmp[StringSize];\r
fprintf(f,"; %s\n",ctime(&t));\r
fprintf(f,IniIntro,option_get_string(Option,"EngineName"));\r
fprintf(f,"[PolyGlot]\n");\r
- fprintf(f,"EngineName=%s\n",\r
- option_get_string(Option,"EngineName"));\r
- fprintf(f,"EngineCommand=%s\n",\r
- option_get_string(Option,"EngineCommand"));\r
- fprintf(f,"EngineDir=%s\n",\r
- option_get_string(Option,"EngineDir"));\r
ini_start_iter(ini);\r
while((entry=ini_next(ini))){\r
if(my_string_case_equal(entry->section,"polyglot")){\r
\r
if(my_string_equal(option_get_string(Option,"PersistFile"),"<empty>")){\r
char tmp[StringSize];\r
+ int i;\r
snprintf(tmp,sizeof(tmp),"%s.ini",\r
option_get_string(Option,"EngineName"));\r
tmp[sizeof(tmp)-1]='\0';\r
+ for(i=0;i<strlen(tmp);i++){\r
+ if(tmp[i]==' '){\r
+ tmp[i]='_';\r
+ }\r
+ }\r
option_set(Option,"PersistFile",tmp);\r
}\r
\r
if(my_string_case_equal(name,"Defaults")){\r
option_start_iter(Uci->option);\r
while((opt=option_next(Uci->option))){\r
- if(!IS_BUTTON(opt)){\r
+ if(!IS_BUTTON(opt->type)){\r
// also sets opt->value\r
uci_send_option(Uci,opt->name,opt->default_);\r
}\r
}\r
option_start_iter(Option);\r
while((opt=option_next(Option))){\r
- if(!IS_BUTTON(opt)){\r
+ if(!IS_BUTTON(opt->type)){\r
polyglot_set_option(opt->name,opt->default_);\r
}\r
}\r
\r
void quit() {\r
\r
- ini_t empty[1];\r
+ ini_t ini[1];\r
char persist_path[StringSize];\r
int ret;\r
\r
- ini_init(empty);\r
+ ini_init(ini);\r
\r
my_log("POLYGLOT *** QUIT ***\n");\r
\r
// engine is started. \r
if(!my_string_case_equal(option_get(Option,"PersistFile"),\r
"<empty>")){\r
- my_path_join(persist_path,\r
- option_get(Option,"PersistDir"),\r
- option_get(Option,"PersistFile"));\r
- if(option_get_bool(Option,"Persist")){\r
- write_ini(persist_path,\r
- Option,Uci->option);\r
- }else if(!my_string_case_equal(option_get_default(Option,"Persist"),\r
- option_get_string(Option,"Persist"))){\r
- // Hack\r
- ini_insert_ex(empty,"PolyGlot","Persist","false");\r
- write_ini_ex(persist_path,empty);\r
- }else{\r
- write_ini_ex(persist_path,empty);\r
+ // Persistence should only work in XBOARD mode.\r
+ // In UCI mode the GUI is responsible for remembering options.\r
+ if(!option_get_bool(Option,"UCI")){\r
+ my_path_join(persist_path,\r
+ option_get(Option,"PersistDir"),\r
+ option_get(Option,"PersistFile"));\r
+ make_ini(ini);\r
+ if(option_get_bool(Option,"Persist")){\r
+ write_ini(persist_path,ini);\r
+ }else if(!my_string_case_equal(option_get_default(Option,"Persist"),\r
+ option_get_string(Option,"Persist"))){\r
+ // Hack\r
+ ini_insert_ex(ini,"polyglot","Persist","false");\r
+ write_ini(persist_path,ini);\r
+ }else{\r
+ write_ini(persist_path,ini);\r
+ }\r
+ my_log("POLYGLOT Calling exit\n");\r
}\r
- my_log("POLYGLOT Calling exit\n");\r
}\r
exit(EXIT_SUCCESS);\r
}\r
option_list_t Option[1];\r
\r
option_t DefaultOptions[] = { \r
- { "OptionFile", "string","0","0", "polyglot.ini", NULL,0,NNB, PG}, \r
+ { "OptionFile", "file","0","0", "polyglot.ini", NULL,0,NNB, PG}, \r
\r
// options\r
\r
- { "Persist", "check","0","0", "true" , NULL,0,NNB, PG|XBOARD},\r
- { "PersistFile", "string","0","0", "<empty>" , NULL,0,NNB, PG},\r
- { "PersistDir", "string","0","0", "<empty>" , NULL,0,NNB, PG},\r
+ { "Persist", "check","0","0", "true" , NULL,0,NNB, PG|XBOARD},\r
+ { "PersistFile", "file","0","0", "<empty>" , NULL,0,NNB, PG},\r
+ { "PersistDir", "path","0","0", "<empty>" , NULL,0,NNB, PG},\r
\r
{ "EngineName", "string","0","0", "<empty>" , NULL,0,NNB, PG}, \r
- { "EngineDir", "string","0","0", "." , NULL,0,NNB, PG}, \r
+ { "EngineDir", "path","0","0", "." , NULL,0,NNB, PG}, \r
{ "EngineCommand", "string","0","0", "<empty>" , NULL,0,NNB, PG}, \r
\r
{ "Log", "check","0","0", "false" , NULL,0,NNB, PG|XBOARD|UCI}, \r
- { "LogFile", "string","0","0", "polyglot.log", NULL,0,NNB, PG|XBOARD|UCI}, \r
+ { "LogFile", "file","0","0", "polyglot.log", NULL,0,NNB, PG|XBOARD|UCI}, \r
\r
{ "UCI", "check","0","0", "false" , NULL,0,NNB, PG}, \r
\r
{ "MateScore", "spin","0","100000", "10000" , NULL,0,NNB, PG|XBOARD}, \r
\r
{ "Book", "check","0","0", "false" , NULL,0,NNB, PG|XBOARD|UCI}, \r
- { "BookFile", "string","0","0", "book.bin" , NULL,0,NNB, PG|XBOARD|UCI}, \r
+ { "BookFile", "file","0","0", "book.bin" , NULL,0,NNB, PG|XBOARD|UCI}, \r
\r
{ "BookRandom", "check","0","0", "true" , NULL,0,NNB, PG|XBOARD|UCI}, \r
{ "BookDepth", "spin","0","256", "256" , NULL,0,NNB, PG|XBOARD}, \r
snprintf(PersistDir,sizeof(PersistDir),"%s/.polyglot",home_dir);\r
PersistDir[sizeof(PersistDir)-1]='\0';\r
#else\r
- sprintf(PersistDir,".\\Polyglot Settings");\r
+ sprintf(PersistDir,".\\_PG");\r
#endif\r
option_set(Option,"PersistDir",PersistDir);\r
option_set_default(Option,"PersistDir",PersistDir);\r
#define PG (1<<2)\r
#define OptionNb 256\r
\r
-#define IS_BUTTON(opt) (my_string_case_equal(opt->type,"button") || \\r
- my_string_case_equal(opt->type,"save") || \\r
- my_string_case_equal(opt->type,"reset")) \\r
+#define IS_BUTTON(str) (my_string_case_equal(str,"button") || \\r
+ my_string_case_equal(str,"save") || \\r
+ my_string_case_equal(str,"reset")) \\r
\r
-#define IS_SPIN(opt) (my_string_case_equal(opt->type,"spin") || \\r
- my_string_case_equal(opt->type,"slider")) \\r
+#define IS_SPIN(str) (my_string_case_equal(str,"spin") || \\r
+ my_string_case_equal(str,"slider")) \\r
+\r
+#define IS_STRING(str) (my_string_case_equal(str,"string") || \\r
+ my_string_case_equal(str,"path") || \\r
+ my_string_case_equal(str,"file")) \\r
\r
// types\r
\r
-.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
+.\" Automatically generated by Pod::Man 2.1801 (Pod::Simple 3.05)
.\"
.\" Standard preamble:
.\" ========================================================================
-.de Sh \" Subsection heading
-.br
-.if t .Sp
-.ne 5
-.PP
-\fB\\$1\fR
-.PP
-..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
-.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.ie \nF \{\
.\" ========================================================================
.\"
.IX Title "POLYGLOT 6"
-.TH POLYGLOT 6 "2009-09-04" "" ""
+.TH POLYGLOT 6 "2009-09-05" "" ""
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
polyglot perft [\-fen fen] [\-max\-depth depth]
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
-.Sh "PolyGlot as adapter and book engine"
+.SS "PolyGlot as adapter and book engine"
.IX Subsection "PolyGlot as adapter and book engine"
PolyGlot is a \*(L"\s-1UCI\s0 adapter\*(R". It connects a \s-1GUI\s0 interface (such as
XBoard, Winboard, Arena or Chessbase) to a \s-1UCI\s0 chess engine.
.PP
\&\s-1NOTE:\s0 Not all options are exported, only those that make sense in the
given mode.
-.Sh "Book making utilities"
+.SS "Book making utilities"
.IX Subsection "Book making utilities"
PolyGlot supports the \*(L"PolyGlot opening book format\*(R". This is the
defacto standard non-proprietary opening book format. It is fully documented
utility info-book will attempt to count the isolated positions which
require a player to make a non-book move when a book move is available.
Due to the possibility of transpositions this is not a fool proof method.
-.Sh "Epd test mode"
+.SS "Epd test mode"
.IX Subsection "Epd test mode"
In epd test mode, PolyGlot will search positions in an epd file and
record the number of times the right best move was found. The
arguments specify when to stop the search in any given position.
-.Sh "Perft counts"
+.SS "Perft counts"
.IX Subsection "Perft counts"
A perft count is the number of legal move sequence in a given position
up to a given depth. PolyGlot can perform such perft counts. It
This is an alias for \-pg \*(L"Book=true\*(R" \-pg \*(L"BookFile=<value>\*(R".
.PP
When invoked as
-.Sh "polyglot make-book"
+.SS "polyglot make-book"
.IX Subsection "polyglot make-book"
PolyGlot supports the following options
.ie n .IP "\fB\-pgn\fR (default: ""book.pgn"")" 4
.PP
When invoked
as
-.Sh "polyglot merge-book"
+.SS "polyglot merge-book"
.IX Subsection "polyglot merge-book"
PolyGlot supports the following options
.IP "\fB\-in1\fR" 4
.PP
When invoked
as
-.Sh "polyglot dump-book"
+.SS "polyglot dump-book"
.IX Subsection "polyglot dump-book"
PolyGlot supports the following options
.IP "\fB\-bin\fR (default: book.bin)" 4
.PP
When invoked
as
-.Sh "polyglot info-book"
+.SS "polyglot info-book"
.IX Subsection "polyglot info-book"
PolyGlot supports the following options
.IP "\fB\-bin\fR (default: book.bin)" 4
Note that this takes a very long time.
.PP
When invoked as
-.Sh "polyglot epd-test"
+.SS "polyglot epd-test"
.IX Subsection "polyglot epd-test"
(possibly with a config file as first argument) PolyGlot supports
besides the generic options described above the following additional
Minimal search time when the search is stopped using \*(L"\-depth\-delta\*(R".
.PP
When invoked as
-.Sh "polyglot perft"
+.SS "polyglot perft"
.IX Subsection "polyglot perft"
PolyGlot supports the following
options
values. If you want to avoid this, or if you want use one of
the comment characters # or ; in option values (such as for NalimovPath),
enclose the value in quotes.
-.Sh "[PolyGlot] section"
+.SS "[PolyGlot] section"
.IX Subsection "[PolyGlot] section"
This section is used by PolyGlot only. The engine is unaware of these
options. The list of available options is detailed below.
.IX Item "BookRandom (default: true)"
Select moves according to their weights in the book. If false the move
with the highest weight is selected.
-.IP "\fBBookRandom\fR (default: true)" 4
-.IX Item "BookRandom (default: true)"
-Select moves according to their weights in the book. If false the move
-with the highest weight is selected.
+.IP "\fBBookLearn\fR (default: false)" 4
+.IX Item "BookLearn (default: false)"
+Store learning information in the book (which must be writable). Currently
+no engine actually uses this information.
.IP "\fBBookDepth\fR (default: 256)" 4
.IX Item "BookDepth (default: 256)"
Stop using the book after this number of moves.
.el .IP "\fBPersistDir\fR (default: \f(CW$HOME\fR/.polyglot on Linux; ``.\ePolyglot Settings'' on Windows)" 4
.IX Item "PersistDir (default: $HOME/.polyglot on Linux; .Polyglot Settings on Windows)"
The directory where the PersistFile is stored.
-.Sh "Work arounds"
+.SS "Work arounds"
.IX Subsection "Work arounds"
Work arounds are identical to options except that they should be used
only when necessary. Their purpose is to try to hide problems with
Old version of Winboard clear the engine output window at depth 1. With this
work around \s-1PG\s0 will send info lines at depth >=2. This may or may not improve
the display.
-.Sh "[Engine] section"
+.SS "[Engine] section"
.IX Subsection "[Engine] section"
This section contains engine \s-1UCI\s0 options. PolyGlot does not
understand them, but sends the information to the engine at startup
Select moves according to their weights in the book. If false the move
with the highest weight is selected.
-=item B<BookRandom> (default: true)
+=item B<BookLearn> (default: false)
-Select moves according to their weights in the book. If false the move
-with the highest weight is selected.
+Store learning information in the book (which must be writable). Currently
+no engine actually uses this information.
=item B<BookDepth> (default: 256)
Summary: A Winboard protocol to UCI protocol adapter
Name: polyglot
-Version: 1.4.45b
+Version: 1.4.46b
Release: 1
License: GPL
Group: Amusement/Games
\r
// functions\r
\r
+\r
+// uci_adapt_UCI3()\r
+\r
+static void apply_UCI3_heuristics(option_t *opt){\r
+ if(option_get_int(Option,"UCIVersion")>2){\r
+ return;\r
+ }\r
+ if(!my_string_equal(opt->type,"string")){\r
+ return;\r
+ }\r
+ if(!strncmp(opt->name,"UCI_",4)){\r
+ return;\r
+ }\r
+ if(my_string_case_contains(opt->name,"file")){\r
+ my_string_set(&opt->type,"file");\r
+ return;\r
+ }\r
+ if(my_string_case_contains(opt->name,"path")){\r
+ my_string_set(&opt->type,"path");\r
+ return;\r
+ }\r
+}\r
+\r
// uci_set_threads()\r
\r
void uci_set_threads(uci_t * uci, int n) {\r
opt=option_find(uci->option,option);\r
if(opt){\r
found=TRUE;\r
- if(!IS_BUTTON(opt)){\r
+ if(!IS_BUTTON(opt->type)){\r
if(!my_string_equal(opt->value,value)){\r
engine_send(uci->engine,"setoption name %s value %s",\r
opt->name,value);\r
}\r
\r
parse_close(parse);\r
+\r
+ apply_UCI3_heuristics(opt);\r
option_insert(uci->option,opt);\r
option_free(opt);\r
\r
static void send_uci_options();
+
+// normalize_type()
+
+static void normalize_type(char *dst, const char* src){
+ if(option_get_int(Option,"UCIVersion") <=2){
+ if(IS_STRING(src)){
+ strcpy(dst,"string");
+ return;
+ }else if(IS_SPIN(src)){
+ strcpy(dst,"spin");
+ }else if(IS_BUTTON(src)){
+ strcpy(dst,"button");
+ }else{
+ strcpy(dst,src);
+ }
+ }else{
+ strcpy(dst,src);
+ }
+}
+
// parse_position()
static void parse_position(const char string[]) {
static void format_uci_option_line(char * option_line,option_t *opt){
char option_string[StringSize];
+ char type[StringSize];
int j;
strcpy(option_line,"");
// buffer overflow alert
}
sprintf(option_string," %s",opt->name);
strcat(option_line,option_string);
- sprintf(option_string," type %s",opt->type);
+ normalize_type(type,opt->type);
+ sprintf(option_string," type %s",type);
strcat(option_line,option_string);
- if(!IS_BUTTON(opt)){
- sprintf(option_string," default %s",opt->default_);
+ if(!IS_BUTTON(opt->type)){
+ sprintf(option_string," default %s",opt->value);
strcat(option_line,option_string);
}
- if(IS_SPIN(opt)){
+ if(IS_SPIN(opt->type)){
sprintf(option_string," min %s",opt->min);
strcat(option_line,option_string);
}
- if(IS_SPIN(opt)){
+ if(IS_SPIN(opt->type)){
sprintf(option_string," max %s",opt->max);
strcat(option_line,option_string);
}
return FALSE;\r
}\r
\r
+// my_strtolower()\r
+\r
+void my_string_tolower(char *dst, const char *src){\r
+ int c;\r
+ ASSERT(src!=NULL);\r
+ ASSERT(dst!=NULL);\r
+ while((c=*(src++))){\r
+ *dst=tolower(c);\r
+ dst++;\r
+ }\r
+ *(dst++)='\0';\r
+}\r
+\r
+// my_string_case_contains()\r
+\r
+const char* my_string_case_contains(const char string_1[], const char string_2[]){\r
+ \r
+ char tmp1[StringSize];\r
+ char tmp2[StringSize];\r
+ char *where;\r
+\r
+\r
+ ASSERT(string_1!=NULL);\r
+ ASSERT(string_2!=NULL);\r
+\r
+ my_string_tolower(tmp1,string_1);\r
+ my_string_tolower(tmp2,string_2);\r
+\r
+ where=strstr(tmp1,tmp2);\r
+ if(where){\r
+ return string_1+(where-tmp1);\r
+ }\r
+ return NULL;\r
+\r
+ \r
+}\r
+\r
+\r
// my_strdup()\r
\r
char * my_strdup(const char string[]) {\r
*variable = my_strdup(string);\r
}\r
\r
+// now_real()\r
+\r
double now_real() {\r
#ifndef _WIN32\r
struct timeval tv[1];\r
extern bool my_string_whitespace (const char string[]);\r
extern bool my_string_equal (const char string_1[], const char string_2[]);\r
extern bool my_string_case_equal (const char string_1[], const char string_2[]);\r
+extern const char* my_string_case_contains(const char haystack[], \r
+ const char needle[]);\r
+\r
+\r
+extern bool my_string_to_lower (char dst[], const char src[]);\r
+\r
extern char * my_strdup (const char string[]);\r
\r
extern void my_string_clear (const char * * variable);\r
strcat(option_line,option_string);\r
sprintf(option_string," -%s",opt->type);\r
strcat(option_line,option_string);\r
- if(!IS_BUTTON(opt) && strcmp(opt->type,"combo")){\r
+ if(!IS_BUTTON(opt->type) && strcmp(opt->type,"combo")){\r
if(strcmp(opt->type,"check")){\r
sprintf(option_string," %s",opt->value);\r
}else{\r
}\r
strcat(option_line,option_string);\r
}\r
- if(IS_SPIN(opt)){\r
+ if(IS_SPIN(opt->type)){\r
sprintf(option_string," %s",opt->min);\r
strcat(option_line,option_string);\r
}\r
- if(IS_SPIN(opt)){\r
+ if(IS_SPIN(opt->type)){\r
sprintf(option_string," %s",opt->max);\r
strcat(option_line,option_string);\r
}\r