[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 193/255: calculate the final score
From: |
Eric Schulte |
Subject: |
[elpa] 193/255: calculate the final score |
Date: |
Sun, 16 Mar 2014 01:02:47 +0000 |
eschulte pushed a commit to branch go
in repository elpa.
commit f16e3e5266250f219c83dee6c46c5557daf4af45
Author: Eric Schulte <address@hidden>
Date: Sun May 19 18:35:17 2013 -0600
calculate the final score
---
back-ends/gtp.el | 2 ++
back-ends/igs.el | 3 +++
back-ends/sgf.el | 3 +++
go-api.el | 1 +
go-board.el | 3 ++-
5 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/back-ends/gtp.el b/back-ends/gtp.el
index 4b9724e..4343edc 100644
--- a/back-ends/gtp.el
+++ b/back-ends/gtp.el
@@ -134,4 +134,6 @@
(defmethod go-quit ((gtp gtp)) (gtp-command gtp "quit"))
+(defmethod go-score ((gtp gtp)) (gtp-command gtp "final_score"))
+
(provide 'gtp)
diff --git a/back-ends/igs.el b/back-ends/igs.el
index 29f53d5..8ab9799 100644
--- a/back-ends/igs.el
+++ b/back-ends/igs.el
@@ -455,4 +455,7 @@ This is used to re-send messages to keep the IGS server
from timing out.")
(defmethod go-quit ((igs igs))
(with-igs igs (igs-send "quit")))
+(defmethod go-score ((igs igs))
+ (signal 'unsupported-back-end-command (list igs :score)))
+
(provide 'igs)
diff --git a/back-ends/sgf.el b/back-ends/sgf.el
index 17052b2..185753b 100644
--- a/back-ends/sgf.el
+++ b/back-ends/sgf.el
@@ -188,4 +188,7 @@
(when (y-or-n-p "Save game to file: ")
(sgf-to-file sgf (read-file-name "Save game to: "))))
+(defmethod go-score ((sgf sgf))
+ (signal 'unsupported-back-end-command (list sgf :score)))
+
(provide 'sgf)
diff --git a/go-api.el b/go-api.el
index 5eb24d6..13cd9f4 100644
--- a/go-api.el
+++ b/go-api.el
@@ -75,5 +75,6 @@
(defgeneric go-resign (back-end) "Send resign to BACK-END.")
(defgeneric go-reset (back-end) "Send reset to BACK-END.")
(defgeneric go-quit (back-end) "Quit the BACK-END.")
+(defgeneric go-score (back-end) "Ask BACK-END to report the final score.")
(provide 'go-api)
diff --git a/go-board.el b/go-board.el
index ff8488a..89e5e05 100644
--- a/go-board.el
+++ b/go-board.el
@@ -392,7 +392,8 @@
(when *autoplay*
(when (equalp :pass (go-board-next))
;; TODO: print the score
- (message "Game Over")))))
+ (message "final score: %s"
+ (with-backends back (go-score back)))))))
(defun go-board-undo (&optional num)
(interactive "p")
- [elpa] 156/255: chunking responses from IGS server into full lines, (continued)
- [elpa] 156/255: chunking responses from IGS server into full lines, Eric Schulte, 2014/03/15
- [elpa] 183/255: explicit connection method for back-end objects, Eric Schulte, 2014/03/15
- [elpa] 179/255: track and display prisoners, Eric Schulte, 2014/03/15
- [elpa] 184/255: safer and automatic quitting, Eric Schulte, 2014/03/15
- [elpa] 186/255: better interactive debugging, Eric Schulte, 2014/03/15
- [elpa] 191/255: don't throw error when backend passes, Eric Schulte, 2014/03/15
- [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 <=
- [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, 2014/03/15
- [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