diff options
| author | John Wiegley <johnw@newartisans.com> | 2002-04-09 04:26:02 +0000 |
|---|---|---|
| committer | John Wiegley <johnw@newartisans.com> | 2002-04-09 04:26:02 +0000 |
| commit | 6b8ac5acf330b03e88d0b342c79abbb7d338e0c2 (patch) | |
| tree | 9df6dc3602f81a1acd5f2d6d234b6e4f6a45d57f /chess-gnuchess.el | |
| parent | 18f22844af74b15732d7fc7dfad318a1ba0c0d99 (diff) | |
Bug fixes and the beginnings of ICS client support
Diffstat (limited to 'chess-gnuchess.el')
| -rw-r--r-- | chess-gnuchess.el | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/chess-gnuchess.el b/chess-gnuchess.el index 1d87173..c619bb3 100644 --- a/chess-gnuchess.el +++ b/chess-gnuchess.el @@ -17,8 +17,6 @@ :type 'file :group 'chess-gnuchess) -(defvar chess-gnuchess-now-moving nil) - (defvar chess-gnuchess-temp-files nil) (defvar chess-gnuchess-bad-board nil) (make-variable-buffer-local 'chess-gnuchess-temp-files) @@ -28,13 +26,8 @@ (list (cons (concat "My move is : \\(" chess-algebraic-regexp "\\)") (function (lambda () - (let* ((move (match-string 1)) - (ply (chess-algebraic-to-ply - (chess-engine-position nil) move))) - (unless ply - (error "Could not convert engine move: %s" move)) - (let ((chess-gnuchess-now-moving t)) - (funcall chess-engine-response-handler 'move ply)))))) + (funcall chess-engine-response-handler 'move + (match-string 1))))) (cons "Illegal move:" (function (lambda () @@ -85,12 +78,11 @@ (setq chess-gnuchess-bad-board nil)) ((eq event 'move) - (unless chess-gnuchess-now-moving - (chess-engine-send nil (concat (chess-ply-to-algebraic (car args)) - "\n")) - (when chess-gnuchess-bad-board - (chess-engine-send nil "go\n") - (setq chess-gnuchess-bad-board nil)))))) + (chess-engine-send nil (concat (chess-ply-to-algebraic (car args)) + "\n")) + (when chess-gnuchess-bad-board + (chess-engine-send nil "go\n") + (setq chess-gnuchess-bad-board nil))))) (provide 'chess-gnuchess) |
