summaryrefslogtreecommitdiff
path: root/chess-announce.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-04-13 01:14:32 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-04-13 01:14:32 +0000
commit3ab3e41f5023e699e56d9b5171264c5e62854540 (patch)
treee9efa453c7b2422034f1ab4e85bf10ae221fa5a2 /chess-announce.el
parent1b173a311002cdd6fa0b0f0dee916815e513f1ed (diff)
*** no comment ***
Diffstat (limited to 'chess-announce.el')
-rw-r--r--chess-announce.el29
1 files changed, 19 insertions, 10 deletions
diff --git a/chess-announce.el b/chess-announce.el
index a713057..f4c8f11 100644
--- a/chess-announce.el
+++ b/chess-announce.el
@@ -52,27 +52,36 @@ See `chess-display-type' for the different kinds of displays."
(target (chess-ply-target ply))
(s-piece (chess-pos-piece pos source))
(t-piece (chess-pos-piece pos target))
+ (which (chess-ply-keyword ply :which))
text)
+ (if which
+ (setq which (char-to-string which)))
(cond
- ((chess-ply-has-keyword ply :castle)
- (setq text "kingside castle"))
- ((chess-ply-has-keyword :long-castle)
- (setq text "queenside castle"))
+ ((chess-ply-keyword ply :castle)
+ (setq text "short castle"))
+ ((chess-ply-keyword ply :long-castle)
+ (setq text "long castle"))
((= t-piece ? )
- (setq text (concat (cdr (assq (downcase s-piece)
+ (setq text (concat which
+ (cdr (assq (downcase s-piece)
chess-announce-names))
" to "
(chess-index-to-coord target))))
(t
- (setq text (concat (cdr (assq (downcase s-piece)
+ (setq text (concat which
+ (cdr (assq (downcase s-piece)
chess-announce-names))
- " takes at "
+ " takes "
+ (cdr (assq (downcase t-piece)
+ chess-announce-names))
+ " at "
(chess-index-to-coord target)))))
- (if (chess-ply-has-keyword :check)
+
+ (if (chess-ply-keyword ply :check)
(setq text (concat text ", check")))
- (if (chess-ply-has-keyword :checkmate)
+ (if (chess-ply-keyword ply :checkmate)
(setq text (concat text ", checkmate")))
- (if (chess-ply-has-keyword :stalemate)
+ (if (chess-ply-keyword ply :stalemate)
(setq text (concat text ", stalemate")))
(funcall (nth 1 chess-announce-functions) text)))))))