summaryrefslogtreecommitdiff
path: root/chess-ply.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-04-26 08:31:16 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-04-26 08:31:16 +0000
commitb6f3fae4d6f47c4098c31059a93dc6cd23cc2c74 (patch)
tree48bdea1837d93c049800713911bcda9ff24a70ca /chess-ply.el
parent6fe3209092928da896f2f5aa7e8bc648efc2e47c (diff)
bug fixes
Diffstat (limited to 'chess-ply.el')
-rw-r--r--chess-ply.el16
1 files changed, 6 insertions, 10 deletions
diff --git a/chess-ply.el b/chess-ply.el
index 750e8b2..b21c21f 100644
--- a/chess-ply.el
+++ b/chess-ply.el
@@ -191,16 +191,12 @@ maneuver."
;; is this a pawn move to the ultimate rank? if so, and
;; we haven't already been told, ask for the piece to
;; promote it to
- (if (and (not (memq :promote changes))
- (= (if color 0 7) (chess-index-rank (cadr changes))))
- (let ((new-piece (completing-read
- (chess-string 'pawn-promote-query)
- chess-piece-name-table nil t "queen")))
- (setq new-piece
- (cdr (assoc new-piece chess-piece-name-table)))
- (if color
- (setq new-piece (upcase new-piece)))
- (nconc changes (list :promote new-piece))))
+ (when (and (not (memq :promote changes))
+ (= (if color 0 7) (chess-index-rank (cadr changes))))
+ (discard-input)
+ (let ((new-piece (if (yes-or-no-p "Promote to queen? ")
+ ?Q ?N)))
+ (nconc changes (list :promote (upcase new-piece)))))
;; is this an en-passant capture?
(if (= (or (chess-pos-en-passant position) 100)