diff options
| author | John Wiegley <johnw@newartisans.com> | 2002-04-10 22:58:11 +0000 |
|---|---|---|
| committer | John Wiegley <johnw@newartisans.com> | 2002-04-10 22:58:11 +0000 |
| commit | e0d27e16375133dbc77778a5787842017673dc4b (patch) | |
| tree | 62b655407aef0c7ed26e05bee32c505dc2242493 /chess-gnuchess.el | |
| parent | fa6fd6dc166f6d333ddb9c94271647956f86598d (diff) | |
added support in chess-link.el to link two engines together. if both
are computers, then they will play head to head
Diffstat (limited to 'chess-gnuchess.el')
| -rw-r--r-- | chess-gnuchess.el | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/chess-gnuchess.el b/chess-gnuchess.el index 0e641fe..dbf529d 100644 --- a/chess-gnuchess.el +++ b/chess-gnuchess.el @@ -23,22 +23,23 @@ (make-variable-buffer-local 'chess-gnuchess-bad-board) (defvar chess-gnuchess-regexp-alist - (list (cons (concat "My move is : \\(" chess-algebraic-regexp "\\)") - (function - (lambda () - (funcall chess-engine-response-handler 'move - (match-string 1))))) - (cons "Illegal move:" - (function - (lambda () - (signal 'chess-illegal "Illegal move")))) - (cons "Board is wrong!" - (function - (lambda () - ;; gnuchess didn't like the given position, which - ;; means it won't play against it unless we send a - ;; "go" after the user's move - (setq chess-gnuchess-bad-board t)))))) + (list + (cons (concat "My move is : \\(" chess-algebraic-regexp "\\)") + (function + (lambda () + (funcall chess-engine-response-handler 'move + (chess-engine-convert-algebraic (match-string 1)))))) + (cons "Illegal move:" + (function + (lambda () + (signal 'chess-illegal "Illegal move")))) + (cons "Board is wrong!" + (function + (lambda () + ;; gnuchess didn't like the given position, which + ;; means it won't play against it unless we send a + ;; "go" after the user's move + (setq chess-gnuchess-bad-board t)))))) (defun chess-gnuchess-handler (event &rest args) (cond |
