[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 192/255: two consecutive passes ends the game
From: |
Eric Schulte |
Subject: |
[elpa] 192/255: two consecutive passes ends the game |
Date: |
Sun, 16 Mar 2014 01:02:46 +0000 |
eschulte pushed a commit to branch go
in repository elpa.
commit ae4640e754246ce4246dac78a0ce981ea6d25e10
Author: Eric Schulte <address@hidden>
Date: Sun May 19 16:28:48 2013 -0600
two consecutive passes ends the game
---
go-board.el | 22 ++++++++++++++--------
1 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/go-board.el b/go-board.el
index 13f16ff..ff8488a 100644
--- a/go-board.el
+++ b/go-board.el
@@ -337,10 +337,11 @@
(defmacro with-backends (sym &rest body)
(declare (indent 1))
- `(ignoring-unsupported
- (prog1 (let ((,sym *back-end*)) ,@body)
- (with-trackers ,sym ,@body))))
-(def-edebug-spec with-backends (place body))
+ `(save-window-excursion
+ (ignoring-unsupported
+ (prog1 (let ((,sym *back-end*)) ,@body)
+ (with-trackers ,sym ,@body)))))
+(def-edebug-spec with-backends (sexp body))
(defvar go-board-actions '(move resign undo comment)
"List of actions which may be taken on an GO board.")
@@ -386,8 +387,12 @@
(defun go-board-pass ()
(interactive)
(with-backends back (go-pass back))
- (setf *turn* (other-color *turn*))
- (when *autoplay* (go-board-next)))
+ (save-window-excursion
+ (setf *turn* (other-color *turn*))
+ (when *autoplay*
+ (when (equalp :pass (go-board-next))
+ ;; TODO: print the score
+ (message "Game Over")))))
(defun go-board-undo (&optional num)
(interactive "p")
@@ -406,8 +411,9 @@
(defun go-board-next (&optional count)
(interactive "p")
- (dotimes (n (or count 1) (or count 1))
- (let ((move (go-move *back-end*)))
+ (let (move)
+ (dotimes (n (or count 1) move)
+ (setf move (go-move *back-end*))
(if (equal move :pass)
(message "pass")
(setf *turn* (other-color *turn*))
- [elpa] 220/255: list buffer navigation, (continued)
- [elpa] 220/255: list buffer navigation, Eric Schulte, 2014/03/15
- [elpa] 217/255: sorting columns, Eric Schulte, 2014/03/15
- [elpa] 216/255: small list buffer tweaks, Eric Schulte, 2014/03/15
- [elpa] 238/255: wrap go-re-cond in save-match-data, Eric Schulte, 2014/03/15
- [elpa] 223/255: use igs-re-cond to handle prompts, Eric Schulte, 2014/03/15
- [elpa] 224/255: handle IGS shouts, Eric Schulte, 2014/03/15
- [elpa] 226/255: remove shouts from comments, Eric Schulte, 2014/03/15
- [elpa] 151/255: Revert "push all buffer-local variables into an igs object", Eric Schulte, 2014/03/15
- [elpa] 237/255: thoughts about browser-based implementation, Eric Schulte, 2014/03/15
- [elpa] 236/255: factor general comint utils out of igs.el, Eric Schulte, 2014/03/15
- [elpa] 192/255: two consecutive passes ends the game,
Eric Schulte <=
- [elpa] 210/255: using curry, rcurry and compose helpers, Eric Schulte, 2014/03/15
- [elpa] 203/255: adding GPL copyright file, Eric Schulte, 2014/03/15
- [elpa] 243/255: undo through gtp pipe, Eric Schulte, 2014/03/15
- [elpa] 246/255: customizable default gnugo options, Eric Schulte, 2014/03/15
- [elpa] 241/255: igs class definitions up front for better loading, Eric Schulte, 2014/03/15
- [elpa] 247/255: notes, Eric Schulte, 2014/03/15
- [elpa] 235/255: better line truncation, Eric Schulte, 2014/03/15
- [elpa] 250/255: mark dead stones at end of game, Eric Schulte, 2014/03/15
- [elpa] 229/255: igs TODO: consistent game un-observation, Eric Schulte, 2014/03/15
- [elpa] 242/255: need assoc for aget, Eric Schulte, 2014/03/15