eschulte pushed a commit to branch go
in repository elpa.
commit d127d39d34392eb54627fee0cfb85a35fc231fb2
Author: Eric Schulte <[email protected]>
Date: Sat Aug 24 17:02:57 2013 -0600
mark dead stones at end of game
---
go-board.el | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/go-board.el b/go-board.el
index 6ed29e9..f459b96 100644
--- a/go-board.el
+++ b/go-board.el
@@ -401,12 +401,22 @@
(setf *turn* (other-color *turn*))
(when *autoplay*
(when (equalp :pass (go-board-next))
+ ;; mark open points
(mapc (lambda (move)
(go-board-mark-point (point-of-pos (cddr move))
(go-board-cross (ecase (car move)
(:B 'black)
(:W 'white)))))
(with-backends back (go-territory back)))
+ ;; mark dead stones
+ (mapc (lambda (move)
+ (let* ((point (point-of-pos (cddr move)))
+ (color (car (get-text-property point :type))))
+ (go-board-mark-point point
+ (go-board-cross (ecase color
+ (:black 'white)
+ (:white 'black))))))
+ (with-backends back (go-dead back)))
(message "final score: %s" (with-backends back (go-score back)))))))
(defun go-board-undo (&optional num)