summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO29
-rw-r--r--chess-display.el17
-rw-r--r--chess-engine.el2
-rw-r--r--chess-game.el10
-rw-r--r--chess-ply.el5
-rw-r--r--chess.texi2
6 files changed, 48 insertions, 17 deletions
diff --git a/TODO b/TODO
index 792cfac..358cbc1 100644
--- a/TODO
+++ b/TODO
@@ -20,6 +20,11 @@
- Make sure chess-pos-move does full validation.
+- Make sure that chess-search-position can find a rook move due to
+ castling. For example, O-O includes Rhf1. So,
+ (chess-search-position ... "f1" ?R) should return the h1 rook, if it
+ could reach that square legally by castling.
+
- In M-x chess, if chess-images is being used, ensure that
chess-images-directory is valid, otherwise fall back on chess-ics1.
@@ -35,10 +40,34 @@
- Make use of the my-color data in chess-game.el to ensure that I only
do what I should be doing
+- Add `chess-display-read-only', to indicate that no changes can be
+ made to the displayed chess board. This would be good for cloned
+ displays, and when observing a bot (or two engines head-to-head).
+
+- Remove `chess-illegal', and just use plain error.
+
+- In the ics12 parser, create the position as part of the ply. This
+ will validate the move, and read in the correct starting position.
+
+- Allow S in the display to send arbitrary text to the end
+
+- Make chess-display-popup-in-... first class citizens
+
+- Have chess-display-popup-in-frame autosize based on the content (if
+ possible)
+
+- There is an ambiguity in keyboard shortcutting between Bxc6 and bxc6
+
+- Remove chess-display-boring-events, and instead use (not
+ chess-display-interesting-events). Otherwise, chess-display.el has
+ to care about an ever growing set of non-display events.
+
----------------------------------------------------------------------
- Clean/rewrite ics.el
+- Add support for ICS observing
+
- Make the mode-line much more informative, with information on who is
playing, etc.
diff --git a/chess-display.el b/chess-display.el
index 4cbd98c..ee8c165 100644
--- a/chess-display.el
+++ b/chess-display.el
@@ -529,9 +529,18 @@ The key bindings available in this mode are:
(if ply
(setq chess-display-mode-line
(concat
- (if (chess-ply-final-p ply)
- " FINISHED"
- (concat " " (if color "White" "Black")))
+ (let ((final (chess-ply-final-p ply)))
+ (cond
+ ((eq final :checkmate)
+ " CHECKMATE")
+ ((eq final :resign)
+ " RESIGNED")
+ ((eq final :stalemate)
+ " STALEMATE")
+ ((eq final :draw)
+ " DRAWN")
+ (t
+ (concat " " (if color "White" "Black")))))
(if index
(concat " " (int-to-string
(if (> index 1)
@@ -669,7 +678,7 @@ Basically, it means we are playing, not editing or reviewing."
(interactive)
(if (chess-display-active-p)
(progn
- (chess-game-resign (chess-display-game nil))
+ (chess-game-end (chess-display-game nil) :resign)
(chess-game-run-hooks chess-display-game 'resign))
(ding)))
diff --git a/chess-engine.el b/chess-engine.el
index 21109e1..4374879 100644
--- a/chess-engine.el
+++ b/chess-engine.el
@@ -151,7 +151,7 @@
((eq event 'resign)
(when game
(message "Your opponent has resigned")
- (chess-game-resign game)
+ (chess-game-end game :resign)
(chess-game-set-data game 'active nil)
t))
diff --git a/chess-game.el b/chess-game.el
index 5ff1d9d..13f88c6 100644
--- a/chess-game.el
+++ b/chess-game.el
@@ -236,13 +236,9 @@ progress (nil), if it is drawn, resigned, mate, etc."
(t
(chess-game-run-hooks game 'move current-ply)))))
-(defsubst chess-game-resign (game)
- "Resign the current game."
- (chess-game-move game (list (chess-game-pos game) :resign)))
-
-(defsubst chess-game-draw (game)
- "Draw the current game."
- (chess-game-move game (list (chess-game-pos game) :draw)))
+(defsubst chess-game-end (game keyword)
+ "End the current game, by resignation, draw, etc."
+ (chess-game-move game (list (chess-game-pos game) keyword)))
(provide 'chess-game)
diff --git a/chess-ply.el b/chess-ply.el
index 391264b..9db4ab7 100644
--- a/chess-ply.el
+++ b/chess-ply.el
@@ -63,11 +63,10 @@
(setcdr ply changes))
(defun chess-ply-has-keyword (ply &rest keywords)
- (let (found)
+ (catch 'found
(dolist (keyword keywords)
(if (memq keyword (chess-ply-changes ply))
- (setq found t)))
- found))
+ (throw found keyword)))))
(defsubst chess-ply-source (ply)
(car (chess-ply-changes ply)))
diff --git a/chess.texi b/chess.texi
index d82f2d7..f2f636c 100644
--- a/chess.texi
+++ b/chess.texi
@@ -446,8 +446,6 @@ object.
@c lispfun chess-engine-detach-game
-@c lispfun chess-engine-pass
-
@c lispfun chess-engine-send
@unnumbered Concept Index