emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/gnugo 5e24ee5 182/357: [gnugo int] Use GTP ‘reg_genmov


From: Stefan Monnier
Subject: [elpa] externals/gnugo 5e24ee5 182/357: [gnugo int] Use GTP ‘reg_genmove’ instead of ‘genmove’.
Date: Sun, 29 Nov 2020 14:51:17 -0500 (EST)

branch: externals/gnugo
commit 5e24ee5ed7038d62451c0697c968e571a7e14377
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>

    [gnugo int] Use GTP ‘reg_genmove’ instead of ‘genmove’.
    
    * packages/gnugo/gnugo.el (gnugo-get-move): ...here.
    (gnugo-get-move-insertion-filter): Extract COLOR
    from :waiting; call ‘gnugo--play-stone’ with it.
---
 gnugo.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/gnugo.el b/gnugo.el
index 8633996..9d37bab 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -1555,9 +1555,11 @@ its move."
     (let* ((so-far (gnugo-get :get-move-string))
            (full   (gnugo-put :get-move-string (concat so-far string))))
       (when (string-match "^= \\(.+\\)\n\n" full)
-        (let ((pos-or-pass (match-string 1 full)))
+        (let ((pos-or-pass (match-string 1 full))
+              (color (gnugo-get :waiting)))
           (gnugo-put :get-move-string nil)
           (gnugo-put :waiting nil)
+          (gnugo--play-stone color pos-or-pass)
           (gnugo-push-move nil pos-or-pass)
           (let ((buf (current-buffer)))
             (let (gnugo-inhibit-refresh)
@@ -1570,7 +1572,9 @@ its move."
   (gnugo-put :waiting color)
   (gnugo--begin-exchange
       (gnugo-get :proc) 'gnugo-get-move-insertion-filter
-    (concat "genmove " color))
+    ;; We used to use ‘genmove’ here, but that forced asymmetry in
+    ;; downstream handling, an impediment to GNU Go vs GNU Go fun.
+    (concat "reg_genmove " color))
   (accept-process-output))
 
 (defun gnugo-cleanup ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]