[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnugo-devel] resign support in obsolete GTP version 1 commands
From: |
Gunnar Farnebäck |
Subject: |
[gnugo-devel] resign support in obsolete GTP version 1 commands |
Date: |
Thu, 11 Nov 2004 06:18:26 +0100 |
User-agent: |
EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/21.3 (sparc-sun-solaris2.9) MULE/5.0 (SAKAKI) |
The GTP command genmove can return "resign" if resignation is enabled
in the engine and the position is sufficiently hopeless. This is all
in accordance with the GTP version 2 specification of genmove.
However, also the obsolete GTP version 1 commands genmove_black and
genmove_white can currently return "resign", which I don't think makes
sense. GTP version 1 is defined by the implementation in GNU Go 3.0,
which would never resign, so this changes the behaviour of a command
which is strictly version 1. Also any application which still uses GTP
version 1 is almost certain not to be able to handle a resign
response.
This patch removes resignation from genmove_black and genmove_white.
- resignation option reverted from GTP commands genmove_black and
genmove_white
/Gunnar
Index: doc/gtp-commands.texi
===================================================================
RCS file: /cvsroot/gnugo/gnugo/doc/gtp-commands.texi,v
retrieving revision 1.22
diff -u -r1.22 gtp-commands.texi
--- doc/gtp-commands.texi 23 Apr 2004 00:23:29 -0000 1.22
+++ doc/gtp-commands.texi 11 Nov 2004 05:18:26 -0000
@@ -815,7 +815,7 @@
Function: Generate and play the supposedly best black move.
Arguments: none
Fails: never
- Returns: a move coordinate or "PASS" (or "resign" if resignation_allowed).
+ Returns: a move coordinate or "PASS"
Status: Obsolete GTP version 1 command.
@@ -829,7 +829,7 @@
Function: Generate and play the supposedly best white move.
Arguments: none
Fails: never
- Returns: a move coordinate (or "PASS")
+ Returns: a move coordinate or "PASS"
Status: Obsolete GTP version 1 command.
@@ -843,7 +843,7 @@
Function: Generate and play the supposedly best move for either color.
Arguments: color to move
Fails: invalid color
- Returns: a move coordinate (or "PASS")
+ Returns: a move coordinate or "PASS" (or "resign" if resignation_allowed)
Status: GTP version 2 standard command.
Index: interface/play_gtp.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/interface/play_gtp.c,v
retrieving revision 1.155
diff -u -r1.155 play_gtp.c
--- interface/play_gtp.c 8 Nov 2004 04:10:02 -0000 1.155
+++ interface/play_gtp.c 11 Nov 2004 05:18:27 -0000
@@ -2342,7 +2342,7 @@
/* Function: Generate and play the supposedly best black move.
* Arguments: none
* Fails: never
- * Returns: a move coordinate or "PASS" (or "resign" if resignation_allowed).
+ * Returns: a move coordinate or "PASS"
*
* Status: Obsolete GTP version 1 command.
*/
@@ -2350,16 +2350,12 @@
gtp_genmove_black(char *s)
{
int move;
- int resign;
UNUSED(s);
if (stackp > 0)
return gtp_failure("genmove cannot be called when stackp > 0");
- move = genmove(BLACK, NULL, &resign);
-
- if (resign)
- return gtp_success("resign");
+ move = genmove(BLACK, NULL, NULL);
play_move(move, BLACK);
@@ -2371,7 +2367,7 @@
/* Function: Generate and play the supposedly best white move.
* Arguments: none
* Fails: never
- * Returns: a move coordinate (or "PASS")
+ * Returns: a move coordinate or "PASS"
*
* Status: Obsolete GTP version 1 command.
*/
@@ -2379,16 +2375,12 @@
gtp_genmove_white(char *s)
{
int move;
- int resign;
UNUSED(s);
if (stackp > 0)
return gtp_failure("genmove cannot be called when stackp > 0");
- move = genmove(WHITE, NULL, &resign);
-
- if (resign)
- return gtp_success("resign");
+ move = genmove(WHITE, NULL, NULL);
play_move(move, WHITE);
@@ -2400,7 +2392,7 @@
/* Function: Generate and play the supposedly best move for either color.
* Arguments: color to move
* Fails: invalid color
- * Returns: a move coordinate (or "PASS")
+ * Returns: a move coordinate or "PASS" (or "resign" if resignation_allowed)
*
* Status: GTP version 2 standard command.
*/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnugo-devel] resign support in obsolete GTP version 1 commands,
Gunnar Farnebäck <=