summaryrefslogtreecommitdiff
path: root/chess-ics.el
diff options
context:
space:
mode:
authorMario Lang <mlang@delysid.org>2004-01-11 23:18:11 +0000
committerMario Lang <mlang@delysid.org>2004-01-11 23:18:11 +0000
commite8f430237750cdb81d5cc2eb021b6c55b9dcfe67 (patch)
treea7889cf53626f6f68c9a498ce18e754a8cdaceaa /chess-ics.el
parentd1415ce53959dfe25a7eea2d0acd191d9a1827a7 (diff)
set epd opcode ce from material-value and checkmate info
Diffstat (limited to 'chess-ics.el')
-rw-r--r--chess-ics.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/chess-ics.el b/chess-ics.el
index 1eaa65c..f1c4239 100644
--- a/chess-ics.el
+++ b/chess-ics.el
@@ -195,8 +195,11 @@ to run whenever the regexp matches.")
(setq parts (cdr parts))
;; material values for each side
- (chess-pos-set-epd position 'ce (* 100 (- (string-to-int (pop parts))
- (string-to-int (pop parts)))))
+ (let ((centipawn (* 100 (- (string-to-int (pop parts))
+ (string-to-int (pop parts))))))
+ (chess-pos-set-epd position 'ce (if (chess-pos-side-to-move position)
+ centipawn
+ (- centipawn))))
;; White's and Black's remaining time
(chess-game-set-data game 'white-remaining (string-to-number (pop parts)))
@@ -223,7 +226,9 @@ to run whenever the regexp matches.")
((= ?+ (aref move (1- (length move))))
(chess-pos-set-status position :check))
((= ?# (aref move (1- (length move))))
- (chess-pos-set-status position :checkmate))
+ (chess-pos-set-status position :checkmate)
+ (chess-pos-set-epd position 'ce (if (chess-pos-side-to-move position)
+ 32767 -32767)))
(nil
;; jww (2002-04-30): what about stalemate? do I need to
;; calculate this each time?