summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Lang <mlang@delysid.org>2014-04-18 01:13:31 +0200
committerMario Lang <mlang@delysid.org>2014-04-18 01:13:31 +0200
commit530b3c3cf0727d311582f6b983b966f3598ea8ba (patch)
treeb1b2499ad0337c7d5abe7255e7a867ed1788f324
parent2be8f82158cb102b5847f47a710e89359352d765 (diff)
chess-legal-plies: Stop generating duplicate castling moves.
-rw-r--r--chess-ply.el19
1 files changed, 1 insertions, 18 deletions
diff --git a/chess-ply.el b/chess-ply.el
index c316eae..fef4bc3 100644
--- a/chess-ply.el
+++ b/chess-ply.el
@@ -428,24 +428,7 @@ position object passed in."
(setq pos (apply 'chess-incr-index pos dir)))
(if (chess-pos-piece-p position pos (not color))
(chess-ply--add nil nil pos))
- (setq pos nil)))
-
- (when (= test-piece ?R)
- (if (eq candidate
- (chess-pos-can-castle position (if color ?K ?k)))
- (let ((changes (chess-ply-castling-changes position)))
- (if changes
- (if chess-ply-throw-if-any
- (throw 'any-found t)
- (push (cons position changes) plies)))))
-
- (if (eq candidate
- (chess-pos-can-castle position (if color ?Q ?q)))
- (let ((changes (chess-ply-castling-changes position t)))
- (if changes
- (if chess-ply-throw-if-any
- (throw 'any-found t)
- (push (cons position changes) plies))))))))
+ (setq pos nil)))))
;; the king is a trivial case of the queen, except when castling
((= test-piece ?K)