[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 118/255: cleanup in go.el
From: |
Eric Schulte |
Subject: |
[elpa] 118/255: cleanup in go.el |
Date: |
Sun, 16 Mar 2014 01:02:31 +0000 |
eschulte pushed a commit to branch go
in repository elpa.
commit e4433ecfab18a39ea6b5806e7423ac507361ec37
Author: Eric Schulte <address@hidden>
Date: Sun May 27 16:50:29 2012 -0600
cleanup in go.el
---
back-ends/gnugo.el | 2 +-
back-ends/gtp.el | 3 +--
back-ends/igs.el | 3 +--
back-ends/sgf.el | 3 +--
go-board.el | 12 +-----------
go-tests.el | 6 +++---
go.el | 18 ++++++++++++++++--
7 files changed, 24 insertions(+), 23 deletions(-)
diff --git a/back-ends/gnugo.el b/back-ends/gnugo.el
index ab4e0f0..5cf9fca 100644
--- a/back-ends/gnugo.el
+++ b/back-ends/gnugo.el
@@ -26,7 +26,7 @@
;; Boston, MA 02110-1301, USA.
;;; CODE:
-(require 'go-util)
+(require 'go)
(require 'gtp)
(require 'comint)
diff --git a/back-ends/gtp.el b/back-ends/gtp.el
index 512265a..7a2321c 100644
--- a/back-ends/gtp.el
+++ b/back-ends/gtp.el
@@ -32,8 +32,7 @@
;; The GMP command set may be implemented as an extension.
;; Code:
-(require 'go-util)
-(require 'go-trans)
+(require 'go)
(defun gtp-expand-color (turn)
(case turn
diff --git a/back-ends/igs.el b/back-ends/igs.el
index 7a6659f..5d3ef40 100644
--- a/back-ends/igs.el
+++ b/back-ends/igs.el
@@ -30,7 +30,6 @@
;; http://www.pandanet.co.jp/English/commands/term/Summary.html
;; Code:
-(require 'go-util)
-(require 'go-trans)
+(require 'go)
(provide 'igs)
diff --git a/back-ends/sgf.el b/back-ends/sgf.el
index 00580e6..4a0c6e0 100644
--- a/back-ends/sgf.el
+++ b/back-ends/sgf.el
@@ -30,8 +30,7 @@
;; This file implements an `go-trans' interface into an SGF file.
;; Code:
-(require 'go-util)
-(require 'go-trans)
+(require 'go)
(defun sgf-nthcdr (sgf index)
(let ((part sgf))
diff --git a/go-board.el b/go-board.el
index d0eb59c..6d1b239 100644
--- a/go-board.el
+++ b/go-board.el
@@ -26,8 +26,7 @@
;; Boston, MA 02110-1301, USA.
;;; Code:
-(require 'go-util)
-(require 'go-trans)
+(require 'go)
(require 'go-board-faces)
(defvar *history* nil "Holds the board history for a GO buffer.")
@@ -331,13 +330,4 @@
(define-derived-mode go-board-mode nil "GO"
"Major mode for viewing a GO board.")
-(defun go-board-play (&optional level)
- (interactive "P")
- (let ((*autoplay* t))
- (go-board
- (make-instance 'gnugo
- :buffer (apply #'gnugo-start-process
- (when level
- (list "--level" (number-to-string level))))))))
-
(provide 'go-board)
diff --git a/go-tests.el b/go-tests.el
index d5b7bd9..8789980 100644
--- a/go-tests.el
+++ b/go-tests.el
@@ -26,13 +26,13 @@
;; Boston, MA 02110-1301, USA.
;;; Code:
-(require 'go-util)
-(require 'sgf2el)
+(require 'ert)
+(require 'go)
(require 'go-board)
(require 'gtp)
(require 'gnugo)
(require 'sgf)
-(require 'ert)
+(require 'sgf2el)
;;; sgf2el tests
diff --git a/go.el b/go.el
index 37394af..a33519c 100644
--- a/go.el
+++ b/go.el
@@ -1,4 +1,4 @@
-;;; go-trans.el --- Translate and transfer between GO back ends
+;;; go.el --- Play GO, translate and transfer between GO back ends
;; Copyright (C) 2012 Eric Schulte <address@hidden>
@@ -37,6 +37,9 @@
(require 'go-util)
(require 'eieio)
+(declare-function go-board "go-board" (back-end &rest trackers))
+(declare-function gnugo-start-process "gnugo.el" (&rest options))
+
(put 'unsupported-back-end-command
'error-conditions
'(error unsupported-back-end-command))
@@ -52,6 +55,17 @@
(defgeneric ,set-name (back-end new))
(defsetf ,name ,set-name))))
+(defun play-go (&optional level)
+ "Play a game of GO against gnugo.
+Optional argument LEVEL specifies gnugo's level of play."
+ (interactive "P")
+ (let ((*autoplay* t))
+ (go-board
+ (make-instance 'gnugo
+ :buffer (apply #'gnugo-start-process
+ (when level
+ (list "--level" (number-to-string level))))))))
+
;; setf'able back-end access
(defgeneric-w-setf go-size "Access BACK-END size.")
(defgeneric-w-setf go-name "Access BACK-END name.")
@@ -67,4 +81,4 @@
(defgeneric go-resign (back-end) "Send resign to BACK-END.")
(defgeneric go-reset (back-end) "Send reset to BACK-END.")
-(provide 'go-trans)
+(provide 'go)
- [elpa] 121/255: better introductory commentary, (continued)
- [elpa] 121/255: better introductory commentary, Eric Schulte, 2014/03/15
- [elpa] 122/255: system-level test combining gnugo and sgf, Eric Schulte, 2014/03/15
- [elpa] 120/255: passing all tests, Eric Schulte, 2014/03/15
- [elpa] 110/255: renaming go-gtp.el to gtp.el, Eric Schulte, 2014/03/15
- [elpa] 125/255: removed dependency on `parse-integer', Eric Schulte, 2014/03/15
- [elpa] 126/255: sketching out passing, Eric Schulte, 2014/03/15
- [elpa] 124/255: highlighting last move and added pass function, Eric Schulte, 2014/03/15
- [elpa] 123/255: working towards savings games in SGF format, Eric Schulte, 2014/03/15
- [elpa] 127/255: documentation tweaks, Eric Schulte, 2014/03/15
- [elpa] 129/255: igs message types from igs.c, Eric Schulte, 2014/03/15
- [elpa] 118/255: cleanup in go.el,
Eric Schulte <=
- [elpa] 130/255: adding a file for tracking development notes, Eric Schulte, 2014/03/15
- [elpa] 128/255: starting to flesh out igs support, Eric Schulte, 2014/03/15
- [elpa] 119/255: test cleanup, Eric Schulte, 2014/03/15
- [elpa] 132/255: moving char-to-num and num-to-char to util, Eric Schulte, 2014/03/15
- [elpa] 115/255: uniform gnugo prefix, Eric Schulte, 2014/03/15
- [elpa] 134/255: notes, Eric Schulte, 2014/03/15
- [elpa] 131/255: transitioning IGS interface to use client mode, Eric Schulte, 2014/03/15
- [elpa] 140/255: board propagates setf'd moves to trackers, Eric Schulte, 2014/03/15
- [elpa] 137/255: setf method for aget, Eric Schulte, 2014/03/15
- [elpa] 133/255: igs using a process filter for asynch processing, Eric Schulte, 2014/03/15