[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 199/255: marking captured territory when game ends
From: |
Eric Schulte |
Subject: |
[elpa] 199/255: marking captured territory when game ends |
Date: |
Sun, 16 Mar 2014 01:02:48 +0000 |
eschulte pushed a commit to branch go
in repository elpa.
commit 805f0bdeb5d39755de16eecbd77030c5fcdcd10a
Author: Eric Schulte <address@hidden>
Date: Mon May 20 18:51:38 2013 -0600
marking captured territory when game ends
---
go-board.el | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/go-board.el b/go-board.el
index 916a7b2..402a4d3 100644
--- a/go-board.el
+++ b/go-board.el
@@ -384,6 +384,9 @@
(interactive)
(with-backends back (go-reset back)))
+(defun go-board-mark-point (point mark)
+ (mapc (lambda (ov) (go-board-mark ov mark)) (overlays-at point)))
+
(defun go-board-pass ()
(interactive)
(with-backends back (go-pass back))
@@ -391,10 +394,13 @@
(setf *turn* (other-color *turn*))
(when *autoplay*
(when (equalp :pass (go-board-next))
- (message "final score: %s territory:%s"
- (with-backends back (go-score back))
- ;; TODO: mark the territory
- (with-backends back (go-territory back)))))))
+ (message "final score: %s" (with-backends back (go-score back)))
+ (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)))))))
(defun go-board-undo (&optional num)
(interactive "p")
- [elpa] 185/255: remove dependencies on org-mode functions, (continued)
- [elpa] 185/255: remove dependencies on org-mode functions, Eric Schulte, 2014/03/15
- [elpa] 176/255: task managment, Eric Schulte, 2014/03/15
- [elpa] 178/255: process igs "tell" messages, Eric Schulte, 2014/03/15
- [elpa] 181/255: NOTES #+option, Eric Schulte, 2014/03/15
- [elpa] 193/255: calculate the final score, Eric Schulte, 2014/03/15
- [elpa] 194/255: notes on scaling image sizes, Eric Schulte, 2014/03/15
- [elpa] 198/255: don't mutate hidden state, Eric Schulte, 2014/03/15
- [elpa] 196/255: mark an overlay with a black or white cross, Eric Schulte, 2014/03/15
- [elpa] 187/255: don't commit if process already quit, Eric Schulte, 2014/03/15
- [elpa] 188/255: adding README, Eric Schulte, 2014/03/15
- [elpa] 199/255: marking captured territory when game ends,
Eric Schulte <=
- [elpa] 197/255: use new mark machinery to apply labels, Eric Schulte, 2014/03/15
- [elpa] 195/255: query backend for territory, Eric Schulte, 2014/03/15
- [elpa] 201/255: print score after marking territory, Eric Schulte, 2014/03/15
- [elpa] 189/255: replace flet with cl-flet, Eric Schulte, 2014/03/15
- [elpa] 190/255: set level (mainly for playing GNUGO), Eric Schulte, 2014/03/15
- [elpa] 204/255: prefix external names with package name, Eric Schulte, 2014/03/15
- [elpa] 165/255: working on placing backgrounds behind pieces, Eric Schulte, 2014/03/15
- [elpa] 202/255: added interface function to view an SGF file, Eric Schulte, 2014/03/15
- [elpa] 205/255: update the README, Eric Schulte, 2014/03/15
- [elpa] 206/255: ensure prisoners are 0 at the start of a new game, Eric Schulte, 2014/03/15