summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO6
-rw-r--r--chess-crafty.el3
-rw-r--r--chess-gnuchess.el4
-rw-r--r--chess-pos.el4
4 files changed, 13 insertions, 4 deletions
diff --git a/TODO b/TODO
index 9e8afc5..c4c7e9e 100644
--- a/TODO
+++ b/TODO
@@ -1,9 +1,11 @@
-- Port image display code to XEmacs
-
- Allow the user to retract a move when playing against an engine.
+- Once a king or rook is moving, removed castling rights!
+
----------------------------------------------------------------------
+- Port image display code to XEmacs
+
- Tie-in to ics.el, by adding "Internet opponent" to the opponents
list.
diff --git a/chess-crafty.el b/chess-crafty.el
index 0c0ffe0..245b350 100644
--- a/chess-crafty.el
+++ b/chess-crafty.el
@@ -67,7 +67,8 @@
((eq event 'move)
(unless chess-crafty-now-moving
- (chess-engine-send nil (concat (chess-ply-to-algebraic (car args)) "\n"))))))
+ (chess-engine-send nil (concat (chess-ply-to-algebraic (car args))
+ "\n"))))))
(provide 'chess-crafty)
diff --git a/chess-gnuchess.el b/chess-gnuchess.el
index e53c871..1151291 100644
--- a/chess-gnuchess.el
+++ b/chess-gnuchess.el
@@ -34,6 +34,7 @@
(setq proc (start-process "chess-process" (current-buffer)
(executable-find "gnuchess")))
(message "Starting chess program 'gnuchess'...done")
+ (process-send-string proc "nopost\n")
proc))
((eq event 'shutdown)
@@ -48,7 +49,8 @@
((eq event 'move)
(unless chess-gnuchess-now-moving
- (chess-engine-send nil (concat (chess-ply-to-algebraic (car args)) "\n"))))))
+ (chess-engine-send nil (concat (chess-ply-to-algebraic (car args))
+ "\n"))))))
(provide 'chess-gnuchess)
diff --git a/chess-pos.el b/chess-pos.el
index df3e511..c558531 100644
--- a/chess-pos.el
+++ b/chess-pos.el
@@ -356,6 +356,8 @@ indices which indicate where a piece may have moved from."
(if (and
(null candidates)
(or (and (equal target (chess-rf-to-index rank 6))
+ (= (chess-pos-piece position (chess-rf-to-index rank 4))
+ (if color ?K ?k))
(chess-pos-can-castle position (if color ?K ?k))
(setq pos (chess-rf-to-index rank 5))
(chess-pos-piece-p position pos ? )
@@ -364,6 +366,8 @@ indices which indicate where a piece may have moved from."
(chess-pos-piece-p position pos ? )
(not (chess-search-position position pos (not color))))
(and (equal target (chess-rf-to-index rank 2))
+ (= (chess-pos-piece position (chess-rf-to-index rank 4))
+ (if color ?K ?k))
(chess-pos-can-castle position (if color ?Q ?q))
(setq pos (chess-rf-to-index rank 1))
(chess-pos-piece-p position pos ? )