[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 99/255: single function to play gnugo
From: |
Eric Schulte |
Subject: |
[elpa] 99/255: single function to play gnugo |
Date: |
Sun, 16 Mar 2014 01:02:27 +0000 |
eschulte pushed a commit to branch go
in repository elpa.
commit 6ea0389dcc00c9a3cec776aaf4b2f9a0406208fc
Author: Eric Schulte <address@hidden>
Date: Sat May 26 16:46:00 2012 -0600
single function to play gnugo
---
go-board.el | 7 +++++++
go-gnugo.el | 8 +++-----
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/go-board.el b/go-board.el
index b13b273..c1e4c02 100644
--- a/go-board.el
+++ b/go-board.el
@@ -304,4 +304,11 @@
(define-derived-mode go-board-mode nil "GO"
"Major mode for viewing a GO board.")
+(defun go-board-play (&optional level)
+ (interactive "P")
+ (go-board-display
+ (make-instance 'gnugo
+ :buffer (apply #'go-gnugo-start-process
+ (when level (list "--level" (number-to-string level)))))))
+
(provide 'go-board)
diff --git a/go-gnugo.el b/go-gnugo.el
index fa70a1e..738a45b 100644
--- a/go-gnugo.el
+++ b/go-gnugo.el
@@ -48,12 +48,12 @@
(defvar go-gnugo-process-name "gnugo"
"name for the gnugo process")
-(defun go-gnugo-start-process (&optional options)
+(defun go-gnugo-start-process (&rest options)
(let ((buffer (apply 'make-comint
go-gnugo-process-name
go-gnugo-program nil
"--mode" "gtp" "--quiet"
- (when options (split-string options)))))
+ options)))
(with-current-buffer buffer (comint-mode))
buffer))
@@ -89,9 +89,7 @@
;;; Class and interface
(defclass gnugo (gtp)
- ((buffer :initarg :buffer
- :accessor buffer
- :initform (go-gnugo-start-process))))
+ ((buffer :initarg :buffer :accessor buffer :initform nil)))
(defmethod gtp-command ((gnugo gnugo) command)
(go-gnugo-command-to-string gnugo command))
- [elpa] 91/255: adding properties to the board string, (continued)
- [elpa] 91/255: adding properties to the board string, Eric Schulte, 2014/03/15
- [elpa] 86/255: playing gnugo, Eric Schulte, 2014/03/15
- [elpa] 94/255: remove old variable from tests, Eric Schulte, 2014/03/15
- [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 <=
- [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, 2014/03/15
- [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