[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 02/02: [gnugo int] Use GTP ‘r eg_genmove’ instead of ‘genmove’.
From: |
Thien-Thi Nguyen |
Subject: |
[elpa] 02/02: [gnugo int] Use GTP ‘r eg_genmove’ instead of ‘genmove’. |
Date: |
Mon, 14 Apr 2014 08:13:30 +0000 |
ttn pushed a commit to branch master
in repository elpa.
commit 7668cbb4338c86715b3be259d7f51904c46dae99
Author: Thien-Thi Nguyen <address@hidden>
Date: Mon Apr 14 10:03:53 2014 +0200
[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.
---
packages/gnugo/gnugo.el | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 8633996..9d37bab 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/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 ()