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

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

[elpa] externals/gnugo a07cf7c 109/357: [gnugo int] Use ‘gnugo--as-pos-


From: Stefan Monnier
Subject: [elpa] externals/gnugo a07cf7c 109/357: [gnugo int] Use ‘gnugo--as-pos-func’ more.
Date: Sun, 29 Nov 2020 14:51:00 -0500 (EST)

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

    [gnugo int] Use ‘gnugo--as-pos-func’ more.
    
    * packages/gnugo/gnugo.el (gnugo-move-history): ...here.
---
 gnugo.el | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/gnugo.el b/gnugo.el
index ce93f1c..342950f 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -660,19 +660,13 @@ For all other values of RSEL, do nothing and return nil."
   (interactive "P")
   (let* ((monkey (gnugo-get :monkey))
          (mem (aref monkey 0))
-         (size (gnugo-get :SZ))
+         (as-pos (gnugo--as-pos-func (gnugo-get :SZ)))
          col
          acc node mprop move)
     (cl-labels
-        ((as-pos (cc) (if (string= "" cc)
-                          "PASS"
-                        (setq col (aref cc 0))
-                        (format "%c%d"
-                                (+ ?A (- (if (> ?i col) col (1+ col)) ?a))
-                                (- size (- (aref cc 1) ?a)))))
-         (as-pos-maybe (x) (if (string= "resign" x)
+        ((as-pos-maybe (x) (if (string= "resign" x)
                                x
-                             (as-pos x)))
+                             (funcall as-pos x)))
          (next (byp) (when (setq node (pop mem)
                                  mprop (gnugo--move-prop node))
                        (setq move (as-pos-maybe (cdr mprop)))



reply via email to

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