summaryrefslogtreecommitdiff
path: root/chess-gnuchess.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-04-11 01:06:10 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-04-11 01:06:10 +0000
commit3375c5ff17acb3e9af7f2c011a6961e0623d02ad (patch)
treea4d175e47627b7d2245893a0ad2334249739853a /chess-gnuchess.el
parentda4dceb58f252519caae28e3b2e049a5bd74c098 (diff)
added undo support
Diffstat (limited to 'chess-gnuchess.el')
-rw-r--r--chess-gnuchess.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/chess-gnuchess.el b/chess-gnuchess.el
index 4d17d83..2950d86 100644
--- a/chess-gnuchess.el
+++ b/chess-gnuchess.el
@@ -92,6 +92,12 @@
(and (chess-engine-game nil)
(chess-engine-set-start-position nil)))
+ ((eq event 'undo)
+ (when (chess-engine-game nil)
+ (dotimes (i (car args))
+ (chess-engine-send nil "undo\n"))
+ (chess-game-undo (chess-engine-game nil) (car args))))
+
((eq event 'move)
(chess-engine-send nil (concat (chess-ply-to-algebraic (car args))
"\n"))