eschulte pushed a commit to branch go in repository elpa. commit b6b46b019eb091058dbd3ef21cecba8d528034cf Author: Eric Schulte <eric.schu...@gmx.com> Date: Tue May 29 14:34:32 2012 -0600
sketching out passing --- back-ends/gtp.el | 12 +++++++----- go-board.el | 6 ++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/back-ends/gtp.el b/back-ends/gtp.el index 1161b5f..42566f4 100644 --- a/back-ends/gtp.el +++ b/back-ends/gtp.el @@ -96,11 +96,13 @@ (signal 'unsupported-back-end-command (list gtp :set-name name))) (defmethod go-move ((gtp gtp)) - (let ((color (go-color gtp))) - (gtp-to-pos color - (case color - (:B (gtp-command gtp "genmove_black")) - (:W (gtp-command gtp "genmove_white")))))) + (let* ((color (go-color gtp)) + (move (case color + (:B (gtp-command gtp "genmove_black")) + (:W (gtp-command gtp "genmove_white"))))) + (if (string= move "PASS") + :pass + (gtp-to-pos color move)))) (defmethod set-go-move ((gtp gtp) move) (gtp-command gtp (go-to-gtp-command move))) diff --git a/go-board.el b/go-board.el index e444113..eb9a111 100644 --- a/go-board.el +++ b/go-board.el @@ -315,8 +315,10 @@ (interactive "p") (dotimes (n (or count 1) (or count 1)) (let ((move (go-move *back-end*))) - (apply-turn-to-board - (cons move (ignoring-unsupported (go-labels *back-end*)))) + (if (equal move :pass) + (message "pass") + (apply-turn-to-board + (cons move (ignoring-unsupported (go-labels *back-end*))))) (mapcar (lambda (tr) (setf (go-move tr) move)) *trackers*) (goto-char (point-of-pos (cddr move)))) (setf *turn* (other-color *turn*))))