summaryrefslogtreecommitdiff
path: root/chess-ai.el
diff options
context:
space:
mode:
authorMario Lang <mlang@delysid.org>2004-01-04 20:59:05 +0000
committerMario Lang <mlang@delysid.org>2004-01-04 20:59:05 +0000
commita4e7a18e4b9dd5a8684b3e0723f082c6c751959c (patch)
tree2d079f0f82eef7a864317142ba077ab4285098df /chess-ai.el
parent98beb3982915f162bf5aadd143ba0041a1bd82e3 (diff)
still not working properly (only display is broken)
Diffstat (limited to 'chess-ai.el')
-rw-r--r--chess-ai.el12
1 files changed, 5 insertions, 7 deletions
diff --git a/chess-ai.el b/chess-ai.el
index 1cb083f..9847fca 100644
--- a/chess-ai.el
+++ b/chess-ai.el
@@ -98,23 +98,21 @@
(setq chess-engine-opponent-name "Emacs AI")
t)
- ((eq event 'setup-pos)
- t)
+ ((eq event 'new)
+ (chess-engine-set-position nil))
((eq event 'move)
(when (= 1 (chess-game-index game))
(chess-game-set-tag game "White" chess-full-name)
- (chess-game-set-tag game "Black" chess-engine-opponent-name))
+ (chess-game-set-tag game "Black" chess-engine-opponent-name))
(if (chess-game-over-p game)
(chess-game-set-data game 'active nil))
- (let ((bm (chess-ai-best-move (chess-engine-position nil) 3)))
- (funcall chess-engine-response-handler 'move
- (cadr bm))))
+ (let ((bm (chess-ai-best-move (chess-engine-position nil) 2)))
+ (funcall chess-engine-response-handler 'move (cadr bm))))
(t
(apply 'chess-common-handler game event args)))))
-
(provide 'chess-ai)
;;; chess-ai.el ends here