diff options
| author | John Wiegley <johnw@newartisans.com> | 2002-04-07 09:45:17 +0000 |
|---|---|---|
| committer | John Wiegley <johnw@newartisans.com> | 2002-04-07 09:45:17 +0000 |
| commit | 48b77c46e15e664ffeab0c612418f4505c48f7b8 (patch) | |
| tree | 9f65bb3a4daff8b0ca1d14a10e089775003cc976 | |
| parent | b9c4e8587ccc764634789ed4f7f808b1c324c681 (diff) | |
*** no comment ***
| -rw-r--r-- | chess-crafty.el | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/chess-crafty.el b/chess-crafty.el index a88a831..d3f1da0 100644 --- a/chess-crafty.el +++ b/chess-crafty.el @@ -8,6 +8,8 @@ (require 'chess-fen) (require 'chess-algebraic) +(defvar chess-crafty-now-moving nil) + (defvar chess-crafty-regexp-alist (list (cons (concat "\\s-*\\(White\\|Black\\)\\s-*([0-9]+):\\s-+\\(" @@ -23,7 +25,8 @@ (setq ply (chess-algebraic-to-ply position move)) (unless ply (error "Could not convert engine move: %s" move)) - (funcall chess-engine-response-handler 'move ply)))))) + (let ((chess-crafty-now-moving t)) + (funcall chess-engine-response-handler 'move ply))))))) (cons "Illegal move:\\s-*\\(.*\\)" (function (lambda () @@ -51,18 +54,23 @@ "alarm off\n" "ansi off\n")) proc)) + ((eq event 'shutdown) (chess-engine-send nil "quit\n")) + ((eq event 'setup) (chess-engine-send nil (format "setboard %s\n" (chess-pos-to-fen (car args))))) + ((eq event 'pass) (chess-engine-send nil "go\n")) + ((eq event 'move) - (chess-engine-send - nil (concat (chess-ply-to-algebraic - (car args) nil - (chess-engine-search-function nil)) "\n"))))) + (unless chess-crafty-now-moving + (chess-engine-send + nil (concat (chess-ply-to-algebraic + (car args) nil + (chess-engine-search-function nil)) "\n")))))) (provide 'chess-crafty) |
