diff options
| author | Mario Lang <mlang@delysid.org> | 2014-03-26 10:52:52 +0100 |
|---|---|---|
| committer | Mario Lang <mlang@delysid.org> | 2014-03-26 10:52:52 +0100 |
| commit | ace6064ebed234ceaa36d9dd7dd12fdaa7f83a20 (patch) | |
| tree | ec2af79cae498412ae1e41b707daa395570665fd /chess-uci.el | |
| parent | 45011d157958aaf9a04047dcb1c05f7a3b43da10 (diff) | |
chess-uci: Choose a (random) move from the book.
Diffstat (limited to 'chess-uci.el')
| -rw-r--r-- | chess-uci.el | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/chess-uci.el b/chess-uci.el index 2413cd8..ad6852c 100644 --- a/chess-uci.el +++ b/chess-uci.el @@ -119,13 +119,13 @@ If conversion fails, this function fired an 'illegal event." (chess-game-set-tag game "White" chess-full-name) (chess-game-set-tag game "Black" chess-engine-opponent-name)) - (let ((book-plies (and chess-uci-book (bufferp chess-uci-book) - (buffer-live-p chess-uci-book) - (chess-polyglot-book-plies chess-uci-book - (chess-game-pos game))))) - (if book-plies + (let ((book-ply (and chess-uci-book (bufferp chess-uci-book) + (buffer-live-p chess-uci-book) + (chess-polyglot-book-ply chess-uci-book + (chess-game-pos game))))) + (if book-ply (let ((chess-display-handling-event nil)) - (funcall chess-engine-response-handler 'move (car book-plies))) + (funcall chess-engine-response-handler 'move book-ply)) (chess-engine-send nil (concat (chess-uci-position game) "go\n")))) (if (chess-game-over-p game) |
