summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Lang <mlang@delysid.org>2004-02-22 23:40:27 +0000
committerMario Lang <mlang@delysid.org>2004-02-22 23:40:27 +0000
commitd2737cb1b780127ab60211ad02b1b778bf6714af (patch)
tree946d6a1ef53c53ed188e82d2bbc58d61dc9cb98e
parent65de55274ce8d49fa67bb555050e2481ebcad2c5 (diff)
(chess-eval-static): Primitive mobility handling, makes play a lot more aggressive :)
-rw-r--r--chess-ai.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/chess-ai.el b/chess-ai.el
index 7aeabe8..55e31f5 100644
--- a/chess-ai.el
+++ b/chess-ai.el
@@ -102,6 +102,18 @@ reply moves. You can only specify the search depth (see `chess-ai-depth')."
(* (length
(chess-pos-passed-pawns position nil black-pawns))
chess-ai-passed-pawn))))
+ ;; Mobility
+ (setq v (+ v
+ (- (length (append (chess-legal-plies position :piece ?Q)
+ (chess-legal-plies position :piece ?R)
+ (chess-legal-plies position :piece ?B)
+ (chess-legal-plies position :piece ?N))
+ )
+ (length (append (chess-legal-plies position :piece ?q)
+ (chess-legal-plies position :piece ?r)
+ (chess-legal-plies position :piece ?b)
+ (chess-legal-plies position :piece ?n))
+ ))))
(if (chess-pos-side-to-move position)
v
(- v)))))))