[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 107/255: can now feed moves from gnugo through to sgf
From: |
Eric Schulte |
Subject: |
[elpa] 107/255: can now feed moves from gnugo through to sgf |
Date: |
Sun, 16 Mar 2014 01:02:29 +0000 |
eschulte pushed a commit to branch go
in repository elpa.
commit d248fbe1d366a9f4918001ddb704d4dbab5063d2
Author: Eric Schulte <address@hidden>
Date: Sun May 27 15:42:41 2012 -0600
can now feed moves from gnugo through to sgf
---
go-gtp.el | 5 +++--
go-sgf.el | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/go-gtp.el b/go-gtp.el
index 68d774f..d236c2a 100644
--- a/go-gtp.el
+++ b/go-gtp.el
@@ -125,8 +125,9 @@
(signal 'unsupported-back-end-command (list gtp :set-alt alt)))
(defmethod go-color ((gtp gtp))
- (let ((last (split-string (gtp-command gtp "last_move"))))
- (case (intern (car last)) ('white :B) ('black :W))))
+ (case (condition-case err
+ (intern (car (split-string (gtp-command gtp "last_move"))))
+ (error 'white)) ('white :B) ('black :W)))
(defmethod set-go-color ((gtp gtp) color)
(signal 'unsupported-back-end-command (list gtp :set-color color)))
diff --git a/go-sgf.el b/go-sgf.el
index ab632bd..de9691a 100644
--- a/go-sgf.el
+++ b/go-sgf.el
@@ -120,11 +120,12 @@
(prev sgf)
(error "sgf: no more moves"))))
+;; TODO: currently this only works with linear sgf files w/o alternatives
(defmethod set-go-move ((sgf sgf) move)
+ (next sgf)
(if (current sgf)
- ;; TODO: this overwrites rather than saving alternatives
(setf (current sgf) (list move))
- (rpush (list move) (go-sgf-ref (self sgf) (butlast (index sgf))))))
+ (setf (self sgf) (rcons (list move) (self sgf)))))
(defmethod go-labels ((sgf sgf))
(let ((turn (current sgf)))
- [elpa] 92/255: worked around stupid bug in mapconcat, (continued)
- [elpa] 92/255: worked around stupid bug in mapconcat, Eric Schulte, 2014/03/15
- [elpa] 93/255: able to play against gnugo, Eric Schulte, 2014/03/15
- [elpa] 95/255: renaming files for go- prefix, Eric Schulte, 2014/03/15
- [elpa] 98/255: *trackers* are multiple subordinate back-ends, Eric Schulte, 2014/03/15
- [elpa] 89/255: tweaks, Eric Schulte, 2014/03/15
- [elpa] 102/255: simpler name for main go-board function, Eric Schulte, 2014/03/15
- [elpa] 100/255: automated playing with gnugo, Eric Schulte, 2014/03/15
- [elpa] 99/255: single function to play gnugo, Eric Schulte, 2014/03/15
- [elpa] 101/255: now with colors, Eric Schulte, 2014/03/15
- [elpa] 106/255: sgf: go-labels shouldn't increment the index, Eric Schulte, 2014/03/15
- [elpa] 107/255: can now feed moves from gnugo through to sgf,
Eric Schulte <=
- [elpa] 105/255: fleshing out the sgf interface, Eric Schulte, 2014/03/15
- [elpa] 103/255: some setter methods for the sgf backend, Eric Schulte, 2014/03/15
- [elpa] 108/255: renaming go-sgf.el to sgf.el, Eric Schulte, 2014/03/15
- [elpa] 97/255: once again passing most tests, Eric Schulte, 2014/03/15
- [elpa] 96/255: renaming sgf->go, Eric Schulte, 2014/03/15
- [elpa] 112/255: renaming go-igs.el to igs.el, Eric Schulte, 2014/03/15
- [elpa] 104/255: new setf'able generic interface, Eric Schulte, 2014/03/15
- [elpa] 114/255: renaming go-gnugo.el to gnugo.el, Eric Schulte, 2014/03/15
- [elpa] 113/255: uniform igs prefix, Eric Schulte, 2014/03/15
- [elpa] 109/255: uniform sgf prefix, Eric Schulte, 2014/03/15