[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 16cbc80 4/6: [gnugo] Include seki groups in game-over data
From: |
Thien-Thi Nguyen |
Subject: |
[elpa] master 16cbc80 4/6: [gnugo] Include seki groups in game-over data. |
Date: |
Tue, 14 Feb 2017 12:28:39 -0500 (EST) |
branch: master
commit 16cbc8055acf7a047a164e5e940b97cbce756507
Author: Thien-Thi Nguyen <address@hidden>
Commit: Thien-Thi Nguyen <address@hidden>
[gnugo] Include seki groups in game-over data.
* packages/gnugo/gnugo.el (gnug-put): Update :game-over doc blurb.
(gnugo-close-game): For resignation case, add empty ‘seki’
to game-over data. For non-resignation case, use GTP command
"final_status_list seki" to obtain a list of seki stones;
collect a group under alist key ‘seki’ if it appears in this list.
---
packages/gnugo/gnugo.el | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index c302774..82da129 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -245,8 +245,8 @@ you may never really understand to any degree of personal
satisfaction\".
:diamond -- the part of the subprocess name after \"gnugo\", may be \"\"
- :game-over -- nil until game over at which time its value is set to
- the alist ((live GROUP ...) (dead GROUP ...))
+ :game-over -- nil until game over at which time its value is set to the
+ alist ((live GROUP ...) (seki GROUP ...) (dead GROUP ...))
:sgf-collection -- after a `loadsgf' command, entire parse tree of file,
a simple list of one or more gametrees, updated in
@@ -855,24 +855,31 @@ For all other values of RSEL, do nothing and return nil."
"\n"))))
(append (ls "black")
(ls "white"))))
+ (seki)
(dead))
(cl-loop
+ with flat-seki = (gnugo-lsquery "final_status_list seki")
with dd = (gnugo-query "dragon_data")
with start = 0
- with (live dead)
+ with (live seki dead)
while (string-match "\\(.+\\):\n[^ ]+[ ]+\\(black\\|white\\)\n"
dd start)
- do (let ((ent (group (match-string 2 dd)
- (gnugo-lsquery "dragon_stones %s"
- (match-string 1 dd)))))
+ do (let* ((mem (match-string 1 dd))
+ (ent (group (match-string 2 dd)
+ (gnugo-lsquery "dragon_stones %s"
+ mem))))
(string-match "\nstatus[ ]+\\(\\(ALIVE\\)\\|[A-Z]+\\)\n"
dd start)
- (if (match-string 2 dd)
- (push ent live)
- (push ent dead))
+ (cond ((member mem flat-seki)
+ (push ent seki))
+ ((match-string 2 dd)
+ (push ent live))
+ (t
+ (push ent dead)))
(setq start (match-end 0)))
finally return
`((live ,@live)
+ (seki ,@seki)
(dead ,@dead)))))))
(defun gnugo--unclose-game ()
- [elpa] master updated (88e48d8 -> a8d009f), Thien-Thi Nguyen, 2017/02/14
- [elpa] master a6c204b 2/6: [gnugo int] Lift redundant pall of death computation., Thien-Thi Nguyen, 2017/02/14
- [elpa] master 7f1b6c8 1/6: [gnugo int] Add abstraction: gnugo--zonk-ovs, Thien-Thi Nguyen, 2017/02/14
- [elpa] master 16cbc80 4/6: [gnugo] Include seki groups in game-over data.,
Thien-Thi Nguyen <=
- [elpa] master a8d009f 6/6: [gnugo] Make ‘C-u F’ store additional SGF properties., Thien-Thi Nguyen, 2017/02/14
- [elpa] master ebbb70a 3/6: [gnugo] Formalize game-over "group"; use symbolic color., Thien-Thi Nguyen, 2017/02/14
- [elpa] master 818f8c6 5/6: [gnugo] Indicate seki groups on the board., Thien-Thi Nguyen, 2017/02/14