+=========1.4.51b================\r
+- Support for new nps command. Code provided by Harm Geert Muller. \r
=========1.4.50b================\r
- Change in architecture. Persistence is disabled. The user is required to push the "Save" button explicitly to save the settings. What is retained is that in case PG is invoked with -noini (or as a special exception for WB 4.4.0 when the config files are polyglot_1st.ini or polyglot_2nd.ini) then PG uses a default config file whose name is derived from the engine name. \r
- New option: OnlyWbOptions (default: true). Restrict the options that PG sends to those that are potentially useful for WinBoard.\r
#define PACKAGE_NAME "polyglot"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "polyglot 1.4.50b"
+#define PACKAGE_STRING "polyglot 1.4.51b"
/* 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.50b"
+#define PACKAGE_VERSION "1.4.51b"
/* 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.50b"
+#define VERSION "1.4.51b"
/* 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.50b.
+# Generated by GNU Autoconf 2.61 for polyglot 1.4.51b.
#
# Report bugs to <michel.vandenbergh@uhasselt.be>.
#
# Identity of this package.
PACKAGE_NAME='polyglot'
PACKAGE_TARNAME='polyglot'
-PACKAGE_VERSION='1.4.50b'
-PACKAGE_STRING='polyglot 1.4.50b'
+PACKAGE_VERSION='1.4.51b'
+PACKAGE_STRING='polyglot 1.4.51b'
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.50b to adapt to many kinds of systems.
+\`configure' configures polyglot 1.4.51b 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.50b:";;
+ short | recursive ) echo "Configuration of polyglot 1.4.51b:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-polyglot configure 1.4.50b
+polyglot configure 1.4.51b
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.50b, which was
+It was created by polyglot $as_me 1.4.51b, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
# Define the identity of the package.
PACKAGE='polyglot'
- VERSION='1.4.50b'
+ VERSION='1.4.51b'
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.50b, which was
+This file was extended by polyglot $as_me 1.4.51b, 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.50b
+polyglot config.status 1.4.51b
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.50b], [michel.vandenbergh@uhasselt.be])
+AC_INIT([polyglot], [1.4.51b], [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.50b";\r
+static const char * const Version = "1.4.51b";\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
Summary: A Winboard protocol to UCI protocol adapter
Name: polyglot
-Version: 1.4.50b
+Version: 1.4.51b
Release: 1
License: GPL
Group: Amusement/Games
\r
double my_time;\r
double opp_time;\r
+\r
+ int node_rate;\r
} xb_t;\r
\r
typedef enum { WAIT, THINK, PONDER, ANALYSE } dummy_state_t;\r
\r
XB->my_time = 300.0;\r
XB->opp_time = 300.0;\r
+\r
+ XB->node_rate = -1;\r
}\r
\r
// xboard2uci_gui_step()\r
XB->result = FALSE;\r
\r
XB->depth_limit = FALSE;\r
+ XB->node_rate=-1;\r
\r
XB->computer = FALSE;\r
my_string_set(&XB->name,"<empty>");\r
ASSERT(XB->ping==-1);\r
gui_send(GUI,"pong %s",Star[0]);\r
}\r
-\r
+ } else if (match(string,"nps *")) {\r
+ \r
+ // fake WB play-by-nodes mode\r
+ XB->node_rate = atoi(Star[0]);\r
} else if (match(string,"playother")) {\r
\r
State->computer[game_turn(Game)] = FALSE;\r
gui_send(GUI,"feature sigterm=0");\r
gui_send(GUI,"feature time=1");\r
gui_send(GUI,"feature usermove=1");\r
+ gui_send(GUI,"feature nps=1");\r
if (XB->has_feature_memory){\r
gui_send(GUI,"feature memory=1");\r
}else{\r
if (XB->time_limit) {\r
\r
// fixed time per move\r
-\r
- engine_send_queue(Engine," movetime %.0f",XB->time_max*1000.0);\r
+ \r
+ if(XB->node_rate > 0){\r
+ engine_send_queue(Engine,\r
+ " nodes %.0f",\r
+ XB->time_max*((double)XB->node_rate));\r
+ }else{\r
+ engine_send_queue(Engine,\r
+ " movetime %.0f",\r
+ XB->time_max*1000.0);\r
+ }\r
\r
} else {\r
\r
// time controls\r
\r
- if (colour_is_white(Uci->board->turn)) {\r
- engine_send_queue(Engine," wtime %.0f btime %.0f",XB->my_time*1000.0,XB->opp_time*1000.0);\r
- } else {\r
- engine_send_queue(Engine," wtime %.0f btime %.0f",XB->opp_time*1000.0,XB->my_time*1000.0);\r
- }\r
-\r
- if (XB->inc != 0.0) engine_send_queue(Engine," winc %.0f binc %.0f",XB->inc*1000.0,XB->inc*1000.0);\r
-\r
- if (XB->mps != 0) {\r
-\r
- move_nb = XB->mps - (Uci->board->move_nb % XB->mps);\r
- ASSERT(move_nb>=1&&move_nb<=XB->mps);\r
-\r
- engine_send_queue(Engine," movestogo %d",move_nb);\r
- }\r
+ if(XB->node_rate > 0) {\r
+ double time;\r
+ move_nb = 40;\r
+ if (XB->mps != 0){\r
+ move_nb = XB->mps - (Uci->board->move_nb % XB->mps);\r
+ }\r
+ time = XB->my_time / move_nb;\r
+ if(XB->inc != 0){\r
+ time += XB->inc;\r
+ }\r
+ if(time > XB->my_time){\r
+ time = XB->my_time;\r
+ }\r
+ engine_send_queue(Engine,\r
+ " nodes %.0f",\r
+ time*XB->node_rate);\r
+ } else {\r
+ \r
+ if (colour_is_white(Uci->board->turn)) {\r
+ engine_send_queue(Engine,\r
+ " wtime %.0f btime %.0f",\r
+ XB->my_time*1000.0,XB->opp_time*1000.0);\r
+ } else {\r
+ engine_send_queue(Engine,\r
+ " wtime %.0f btime %.0f",\r
+ XB->opp_time*1000.0,XB->my_time*1000.0);\r
+ }\r
+ \r
+ if (XB->inc != 0.0){\r
+ engine_send_queue(Engine,\r
+ " winc %.0f binc %.0f",\r
+ XB->inc*1000.0,XB->inc*1000.0);\r
+ }\r
+ if (XB->mps != 0) {\r
+\r
+ move_nb = XB->mps - (Uci->board->move_nb % XB->mps);\r
+ ASSERT(move_nb>=1&&move_nb<=XB->mps);\r
+ \r
+ engine_send_queue(Engine," movestogo %d",move_nb);\r
+ }\r
+ }\r
}\r
-\r
if (XB->depth_limit) engine_send_queue(Engine," depth %d",XB->depth_max);\r
\r
if (State->state == PONDER) engine_send_queue(Engine," ponder");\r