summaryrefslogtreecommitdiff
path: root/chess-gnuchess.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-04-10 23:55:13 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-04-10 23:55:13 +0000
commita0769011c2a98841156559aa37978156766cc09f (patch)
tree407832c3c0fac049e9e7d567614894cc47e76f3c /chess-gnuchess.el
parent5fbbfaf36f1dc7da3c7539568fe473bbf079c513 (diff)
Added support for aborting a game. Use A or N from a display.
Diffstat (limited to 'chess-gnuchess.el')
-rw-r--r--chess-gnuchess.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/chess-gnuchess.el b/chess-gnuchess.el
index dbf529d..4d17d83 100644
--- a/chess-gnuchess.el
+++ b/chess-gnuchess.el
@@ -66,13 +66,11 @@
(chess-game-set-data game 'active t))))
((eq event 'setup-pos)
- (if (equal (car args) chess-starting-position)
- (chess-engine-send nil "new\n")
- (let ((file (make-temp-file "gch")))
- (with-temp-file file
- (insert (chess-pos-to-string (car args)) ?\n))
- (chess-engine-send nil (format "epdload %s\n" file))
- (push file chess-gnuchess-temp-files))))
+ (let ((file (make-temp-file "gch")))
+ (with-temp-file file
+ (insert (chess-pos-to-string (car args)) ?\n))
+ (chess-engine-send nil (format "epdload %s\n" file))
+ (push file chess-gnuchess-temp-files)))
((eq event 'setup-game)
(let ((file (make-temp-file "gch")))
@@ -89,6 +87,11 @@
(chess-engine-send nil "go\n")
(setq chess-gnuchess-bad-board nil))
+ ((memq event '(abort resign))
+ (chess-engine-send nil "new\n")
+ (and (chess-engine-game nil)
+ (chess-engine-set-start-position nil)))
+
((eq event 'move)
(chess-engine-send nil (concat (chess-ply-to-algebraic (car args))
"\n"))