summaryrefslogtreecommitdiff
path: root/chess-perft.el
diff options
context:
space:
mode:
Diffstat (limited to 'chess-perft.el')
-rw-r--r--chess-perft.el28
1 files changed, 2 insertions, 26 deletions
diff --git a/chess-perft.el b/chess-perft.el
index b055d2c..8aa109f 100644
--- a/chess-perft.el
+++ b/chess-perft.el
@@ -63,36 +63,12 @@ The result is a list of the form
(or (chess-pos-piece-p
(chess-ply-pos ply) (chess-ply-target ply)
(not (chess-pos-side-to-move (chess-ply-pos ply))))
- (let ((en-passant (chess-pos-en-passant
- (chess-ply-pos ply))))
- (and en-passant
- (chess-pos-piece-p (chess-ply-pos ply)
- en-passant
- (not
- (chess-pos-side-to-move
- (chess-ply-pos ply))))
- (/= (chess-ply-target ply) en-passant)
- (/= (chess-pos-piece
- (chess-ply-pos ply) en-passant)
- (chess-pos-piece
- (chess-ply-next-pos ply) en-passant))))))
+ (chess-ply-keyword ply :en-passant)))
plies)
;; En passants
(cl-count-if
(lambda (ply)
- (let ((en-passant (chess-pos-en-passant
- (chess-ply-pos ply))))
- (and en-passant
- (chess-pos-piece-p (chess-ply-pos ply)
- en-passant
- (not
- (chess-pos-side-to-move
- (chess-ply-pos ply))))
- (/= (chess-ply-target ply) en-passant)
- (/= (chess-pos-piece
- (chess-ply-pos ply) en-passant)
- (chess-pos-piece
- (chess-ply-next-pos ply) en-passant)))))
+ (chess-ply-keyword ply :en-passant))
plies)
;; Castles
(cl-count-if