[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnugo-devel] arend_1_33.2: undo of GNU Go' PASS in gtp-mode fixed
From: |
Arend Bayer |
Subject: |
[gnugo-devel] arend_1_33.2: undo of GNU Go' PASS in gtp-mode fixed |
Date: |
Sun, 14 Apr 2002 14:53:13 +0200 (CEST) |
If someone has passed, then an undo should take back this pass I assume.
In gtp-mode, undo behaves this way if the pass has been played via
"black PASS"/"white PASS", but not if the PASS was the result of a
"genmove_black"/"genmove_white".
The reason for this is that gtp_genmove_black does not record the PASS
via a call to play_move().
This is fixed by the patch below, which seems clearly correct to me. But
as I am not familiar with the interfaces at all, someone should else should
be convinced of its correctness, too.
Arend
- do put GNU Go's passes in permanent move history
Index: interface/play_gtp.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/interface/play_gtp.c,v
retrieving revision 1.72
diff -u -r1.72 play_gtp.c
--- interface/play_gtp.c 12 Apr 2002 14:23:54 -0000 1.72
+++ interface/play_gtp.c 14 Apr 2002 12:44:03 -0000
@@ -1681,6 +1681,8 @@
if (genmove(&i, &j, BLACK) >= 0)
play_move(POS(i, j), BLACK);
+ else
+ play_move(NO_MOVE, BLACK);
gtp_printid(id, GTP_SUCCESS);
gtp_print_vertex(i, j);
@@ -1703,6 +1705,8 @@
if (genmove(&i, &j, WHITE) >= 0)
play_move(POS(i, j), WHITE);
+ else
+ play_move(NO_MOVE, WHITE);
gtp_printid(id, GTP_SUCCESS);
gtp_print_vertex(i, j);
- [gnugo-devel] arend_1_33.2: undo of GNU Go' PASS in gtp-mode fixed,
Arend Bayer <=