-=========1.4b26===========\r
+=========1.4b27================\r
+- Option "ScoreWhite" : report score from white's point of view (suggested by E.M.).\r
+- Option "KibitzInterval" : try to wait this many seconds between kibitzes (suggested by E.M.)\r
+=========1.4b26================\r
- Contraction of version number.\r
- Log if SetProcessAffinityMask is not available (suggested by E.M.).\r
- pipe.cpp : Make PipeStruct a proper class with private/public members.\r
make dist
rpmbuild -ta polyglot-@VERSION@.tar.gz
-EXTRA_DIST=makefile.gcc polyglot.man polyglot.pod polyglot.spec debian/changelog debian/control debian/docs debian/README debian/compat debian/copyright debian/files debian/polyglot.substvars debian/rules
+EXTRA_DIST=makefile.gcc makefile.ms polyglot.man polyglot.pod polyglot.spec debian/changelog debian/control debian/docs debian/README debian/compat debian/copyright debian/files debian/polyglot.substvars debian/rules
polyglot_SOURCES = mainloop.cpp attack.cpp board.cpp book.cpp book_make.cpp book_merge.cpp colour.cpp engine.cpp epd.cpp fen.cpp gui.cpp game.cpp hash.cpp io.cpp line.cpp list.cpp main.cpp move.cpp move_do.cpp move_gen.cpp move_legal.cpp option.cpp parse.cpp pgn.cpp piece.cpp pipe.cpp posix.cpp random.cpp san.cpp search.cpp square.cpp uci.cpp uci2uci.cpp util.cpp xboard2uci.cpp mainloop.h colour.h hash.h move_gen.h piece.h uci2uci.h attack.h config.h gui.h io.h move.h pipe.h posix.h uci.h board.h engine.h line.h move_legal.h random.h util.h book.h epd.h list.h option.h san.h book_make.h fen.h main.h parse.h search.h book_merge.h game.h move_do.h pgn.h square.h xboard2uci.h
dist_doc_DATA = README README1.3 README1.4 README1.4w README1.4w10UCI book_format.html
man6_MANS = polyglot.man
-EXTRA_DIST = makefile.gcc polyglot.man polyglot.pod polyglot.spec debian/changelog debian/control debian/docs debian/README debian/compat debian/copyright debian/files debian/polyglot.substvars debian/rules
+EXTRA_DIST = makefile.gcc makefile.ms polyglot.man polyglot.pod polyglot.spec debian/changelog debian/control debian/docs debian/README debian/compat debian/copyright debian/files debian/polyglot.substvars debian/rules
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
Show search information during engine pondering. Turning this off
might be better for interactive use in some interfaces.
+ ScoreWhite (default: true)
+ Report score from white's point of view in xboard mode.
+
KibitzMove (default: false)
Whether to kibitz when playing a move.
effect only if "KibitzPV" is selected, move kibitzes are always
sent regardless of the delay.
+ KibitzInterval (default: 0)
+ This is another form of throttling. PolyGlot will usually wait this
+ many seconds before doing the next kibitz.
+
UCI (default: false)
If true PolyGlot will not understand xboard commands.
- 2009-07-20 POLYGLOT(6)
+ 2009-07-26 POLYGLOT(6)
#define PACKAGE_NAME "polyglot"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "polyglot 1.4b26"
+#define PACKAGE_STRING "polyglot 1.4b27"
/* 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.4b26"
+#define PACKAGE_VERSION "1.4b27"
/* 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.4b26"
+#define VERSION "1.4b27"
/* 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.4b26.
+# Generated by GNU Autoconf 2.61 for polyglot 1.4b27.
#
# Report bugs to <michel.vandenbergh@uhasselt.be>.
#
# Identity of this package.
PACKAGE_NAME='polyglot'
PACKAGE_TARNAME='polyglot'
-PACKAGE_VERSION='1.4b26'
-PACKAGE_STRING='polyglot 1.4b26'
+PACKAGE_VERSION='1.4b27'
+PACKAGE_STRING='polyglot 1.4b27'
PACKAGE_BUGREPORT='michel.vandenbergh@uhasselt.be'
ac_unique_file="mainloop.cpp"
# 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.4b26 to adapt to many kinds of systems.
+\`configure' configures polyglot 1.4b27 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.4b26:";;
+ short | recursive ) echo "Configuration of polyglot 1.4b27:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-polyglot configure 1.4b26
+polyglot configure 1.4b27
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.4b26, which was
+It was created by polyglot $as_me 1.4b27, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
# Define the identity of the package.
PACKAGE='polyglot'
- VERSION='1.4b26'
+ VERSION='1.4b27'
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.4b26, which was
+This file was extended by polyglot $as_me 1.4b27, 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.4b26
+polyglot config.status 1.4b27
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.4b26], [michel.vandenbergh@uhasselt.be])
+AC_INIT([polyglot], [1.4b27], [michel.vandenbergh@uhasselt.be])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([mainloop.cpp])
AC_CONFIG_HEADER([config.h])
// constants\r
\r
\r
-static const char * const Version = "1.4b26";\r
+static const char * const Version = "1.4b27";\r
static const char * const HelpMessage = "\\r
SYNTAX\n\\r
* polyglot [configfile]\n\\r
CC = g++
DEFS = -DNDEBUG
-OPTS = -Os -frename-registers -funit-at-a-time -fstrict-aliasing -fstrength-reduce
+OPTS = -Os -frename-registers -funit-at-a-time -fstrict-aliasing -fstrength-reduce -fomit-frame-pointer
CFLAGS = -Wall -pipe $(DEFS) $(OPTS) $(CYGF)
LFLAGS = -fpic -s $(CYGF)
LIBS = $(CYGL)
--- /dev/null
+PROJ = polyglot
+EXE = $(PROJ).exe
+
+OBJS = attack.obj board.obj book.obj book_make.obj book_merge.obj colour.obj\
+ engine.obj epd.obj fen.obj game.obj gui.obj hash.obj io.obj line.obj list.obj\
+ main.obj mainloop.obj move.obj move_do.obj move_gen.obj move_legal.obj\
+ option.obj parse.obj pgn.obj piece.obj pipe.obj posix.obj random.obj san.obj\
+ search.obj square.obj uci.obj uci2uci.obj util.obj xboard2uci.obj
+
+LIBS = oldnames.lib
+
+
+VCVER=6
+DEBUG=0
+
+
+# VC++ version
+!if $(VCVER) >= 8
+CLIB = libcmt
+LIBF = -MT
+DEPRECATE=-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_USE_32BIT_TIME_T
+!else
+VSO = -Gf -Og
+CLIB = msvcrt
+LIBF = -MD
+!endif
+
+
+# Enable debugging?
+!if $(DEBUG) == 0
+CFDEBUG = -DNDEBUG
+OPTS = -Os -Oy -Gs -GA -Zl $(VSO) $(LIBF)
+LFDEBUG = $(CLIB).lib
+!else
+CFDEBUG = -D_DEBUG -DDEBUG
+OPTS = -Od -Zi -Fd$(PROJ).pdb $(LIBF)d
+LFDEBUG = -DEBUG -PDB:$(PROJ).pdb -MAP:$(PROJ).map $(CLIB)d.lib
+!endif
+
+
+CC = @cl
+LINK = link
+#WARN = -W3
+DEFS = $(CFDEBUG) $(DEPRECATE)
+CFLAGS = -c -nologo $(WARN) $(DEFS) $(OPTS)
+LFLAGS = -nologo $(LFDEBUG)
+
+all: $(EXE)
+
+clean:
+ -erase $(OBJS) $(EXE)
+
+$(EXE): $(OBJS)
+ $(LINK) $(LFLAGS) $(OBJS) $(LIBS) -out:$(EXE)
+
+.cpp.obj:
+ $(CC) $(CFLAGS) -c $<
{ "KibitzPV", "check","0","0", "false" , NULL,0,NNB, PG|XBOARD}, \r
\r
{ "KibitzCommand", "string","0","0", "tellall" , NULL,0,NNB, PG|XBOARD}, \r
- { "KibitzDelay", "check","0","10000", "5" , NULL,0,NNB, PG|XBOARD}, \r
+ { "KibitzDelay", "spin","0","10000", "5" , NULL,0,NNB, PG|XBOARD}, \r
+ { "KibitzInterval", "spin","0","10000", "0" , NULL,0,NNB, PG|XBOARD}, \r
\r
{ "ShowPonder", "check","0","0", "false" , NULL,0,NNB, PG|XBOARD}, \r
+ { "ScoreWhite", "check","0","0", "false" , NULL,0,NNB, PG|XBOARD}, \r
\r
// work-arounds\r
\r
.\" ========================================================================
.\"
.IX Title "POLYGLOT 6"
-.TH POLYGLOT 6 "2009-07-20" "" ""
+.TH POLYGLOT 6 "2009-07-26" "" ""
.SH "NAME"
PolyGlot \- Winboard protocol to UCI protocol adapter
\- book engine for Polyglot books
.IX Item "ShowPonder (default: true)"
Show search information during engine pondering. Turning this off
might be better for interactive use in some interfaces.
+.IP "\fBScoreWhite\fR (default: true)" 4
+.IX Item "ScoreWhite (default: true)"
+Report score from white's point of view in xboard mode.
.IP "\fBKibitzMove\fR (default: false)" 4
.IX Item "KibitzMove (default: false)"
Whether to kibitz when playing a move.
How many seconds to wait before starting kibitzing. This has an
effect only if \*(L"KibitzPV\*(R" is selected, move kibitzes are always sent
regardless of the delay.
+.IP "\fBKibitzInterval\fR (default: 0)" 4
+.IX Item "KibitzInterval (default: 0)"
+This is another form of throttling. PolyGlot will usually wait this
+many seconds before doing the next kibitz.
.IP "\fB\s-1UCI\s0\fR (default: false)" 4
.IX Item "UCI (default: false)"
If true PolyGlot will not understand xboard commands.
Show search information during engine pondering. Turning this off
might be better for interactive use in some interfaces.
+=item B<ScoreWhite> (default: true)
+
+Report score from white's point of view in xboard mode.
+
=item B<KibitzMove> (default: false)
Whether to kibitz when playing a move.
xboard command to use for kibitzing, normally "tellall" for kibitzing
or "tellothers" for whispering.
-
=item B<KibitzDelay> (default: 5)
How many seconds to wait before starting kibitzing. This has an
effect only if "KibitzPV" is selected, move kibitzes are always sent
regardless of the delay.
+=item B<KibitzInterval> (default: 0)
+
+This is another form of throttling. PolyGlot will usually wait this
+many seconds before doing the next kibitz.
+
=item B<UCI> (default: false)
If true PolyGlot will not understand xboard commands.
Summary: A Winboard protocol to UCI protocol adapter
Name: polyglot
-Version: 1.4b26
+Version: 1.4b27
Release: 1
License: GPL
Group: Amusement/Games
#include <cstdio>\r
#include <cstdlib>\r
#include <cstring>\r
-\r
+#include <ctime>\r
\r
#include "board.h"\r
#include "book.h"\r
static void search_update ();\r
static void search_clear ();\r
static void update_remaining_time();\r
+static int report_best_score();\r
+static bool kibitz_throttle (bool searching);\r
static void start_protected_command();\r
static void end_protected_command();\r
\r
\r
}\r
\r
+// report_best_score()\r
+\r
+static int report_best_score(){\r
+ if(!option_get_bool("ScoreWhite") || colour_is_white(Uci->board->turn)){\r
+ return Uci->best_score;\r
+ }else{\r
+ return -Uci->best_score;\r
+ }\r
+}\r
+\r
// comp_move()\r
\r
static void comp_move(int move) {\r
line_to_san(Uci->best_pv,Uci->board,pv_string,StringSize);\r
\r
if(Uci->depth==-1) //hack to clear the engine output window\r
- gui_send(GUI,"%d %+d %.0f "S64_FORMAT" ",0,Uci->best_score,Uci->time*100.0,Uci->node_nb);\r
+ gui_send(GUI,"%d %+d %.0f "S64_FORMAT" ",0,report_best_score(),Uci->time*100.0,Uci->node_nb);\r
\r
- gui_send(GUI,"%d %+d %.0f "S64_FORMAT" %s",Uci->best_depth,Uci->best_score,Uci->time*100.0,Uci->node_nb,pv_string);\r
+ gui_send(GUI,"%d %+d %.0f "S64_FORMAT" %s",Uci->best_depth,report_best_score(),Uci->time*100.0,Uci->node_nb,pv_string);\r
\r
} else if (State->state == PONDER && option_get_bool("ShowPonder")) {\r
\r
if (move != MoveNone && move_is_legal(move,board)) {\r
move_to_san(move,board,move_string,256);\r
line_to_san(Uci->best_pv,Uci->board,pv_string,StringSize);\r
- gui_send(GUI,"%d %+d %.0f "S64_FORMAT" (%s) %s",Uci->best_depth,Uci->best_score,Uci->time*100.0,Uci->node_nb,move_string,pv_string);\r
+ gui_send(GUI,"%d %+d %.0f "S64_FORMAT" (%s) %s",Uci->best_depth,report_best_score(),Uci->time*100.0,Uci->node_nb,move_string,pv_string);\r
}\r
}\r
}\r
if (State->state == THINK || State->state == ANALYSE) {\r
\r
line_to_san(Uci->best_pv,Uci->board,pv_string,StringSize);\r
- gui_send(GUI,"%s depth=%d time=%.2f node="S64_FORMAT" speed=%.0f score=%+.2f pv=\"%s\"",option_get_string("KibitzCommand"),Uci->best_depth,Uci->time,Uci->node_nb,Uci->speed,double(Uci->best_score)/100.0,pv_string);\r
-\r
+ if(kibitz_throttle(Uci->searching)){\r
+ gui_send(GUI,"%s depth=%d time=%.2f node="S64_FORMAT" speed=%.0f score=%+.2f pv=\"%s\"",option_get_string("KibitzCommand"),Uci->best_depth,Uci->time,Uci->node_nb,Uci->speed,double(report_best_score())/100.0,pv_string);\r
+ }\r
} else if (State->state == PONDER) {\r
\r
game_get_board(Game,board);\r
if (move != MoveNone && move_is_legal(move,board)) {\r
move_to_san(move,board,move_string,256);\r
line_to_san(Uci->best_pv,Uci->board,pv_string,StringSize);\r
- gui_send(GUI,"%s depth=%d time=%.2f node="S64_FORMAT" speed=%.0f score=%+.2f pv=\"(%s) %s\"",option_get_string("KibitzCommand"),Uci->best_depth,Uci->time,Uci->node_nb,Uci->speed,double(Uci->best_score)/100.0,move_string,pv_string);\r
+ if(kibitz_throttle(Uci->searching)){\r
+ gui_send(GUI,"%s depth=%d time=%.2f node="S64_FORMAT" speed=%.0f score=%+.2f pv=\"(%s) %s\"",option_get_string("KibitzCommand"),Uci->best_depth,Uci->time,Uci->node_nb,Uci->speed,double(report_best_score())/100.0,move_string,pv_string);\r
+ }\r
}\r
}\r
}\r
}\r
\r
+// kibitz_throttle()\r
+\r
+static bool kibitz_throttle(bool searching){\r
+ time_t curr_time;\r
+ static time_t lastKibitzMove=0;\r
+ static time_t lastKibitzPV=0;\r
+ curr_time = time(NULL);\r
+ if(searching){ // KibitzPV\r
+ if(curr_time >= (option_get_int("KibitzInterval") + lastKibitzPV)){\r
+ lastKibitzPV=curr_time;\r
+ return true;\r
+ }\r
+ }else{ // KibitzMove\r
+ if(curr_time >= (option_get_int("KibitzInterval") + lastKibitzMove)){\r
+ lastKibitzPV=curr_time;\r
+ lastKibitzMove=curr_time;\r
+ return true;\r
+ } \r
+ }\r
+ return false;\r
+}\r
+\r
// learn()\r
\r
static void learn(int result) {\r