summaryrefslogtreecommitdiff
path: root/chess-crafty.el
diff options
context:
space:
mode:
Diffstat (limited to 'chess-crafty.el')
-rw-r--r--chess-crafty.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/chess-crafty.el b/chess-crafty.el
index b14db83..880ee14 100644
--- a/chess-crafty.el
+++ b/chess-crafty.el
@@ -87,6 +87,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")))))