[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/play/landmark.el
From: |
Romain Francoise |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/play/landmark.el |
Date: |
Sat, 24 Sep 2005 19:26:35 -0400 |
Index: emacs/lisp/play/landmark.el
diff -c emacs/lisp/play/landmark.el:1.26 emacs/lisp/play/landmark.el:1.27
*** emacs/lisp/play/landmark.el:1.26 Sun Sep 18 12:32:51 2005
--- emacs/lisp/play/landmark.el Sat Sep 24 23:26:26 2005
***************
*** 763,771 ****
(let (square score)
(setq square (lm-point-square))
(cond ((null square)
! (error "Your point is not on a square. Retry !"))
((not (zerop (aref lm-board square)))
! (error "Your point is not on a free square. Retry !"))
(t
(setq score (aref lm-score-table square))
(lm-play-move square 1)
--- 763,771 ----
(let (square score)
(setq square (lm-point-square))
(cond ((null square)
! (error "Your point is not on a square. Retry!"))
((not (zerop (aref lm-board square)))
! (error "Your point is not on a free square. Retry!"))
(t
(setq score (aref lm-score-table square))
(lm-play-move square 1)
***************
*** 790,796 ****
(sit-for 4)
(lm-prompt-for-other-game))
((zerop lm-number-of-human-moves)
! (message "You have not played yet... Your move ?"))
(t
(message "One moment, please...")
;; It is possible for the user to let Emacs play several consecutive
--- 790,796 ----
(sit-for 4)
(lm-prompt-for-other-game))
((zerop lm-number-of-human-moves)
! (message "You have not played yet... Your move?"))
(t
(message "One moment, please...")
;; It is possible for the user to let Emacs play several consecutive
***************
*** 811,819 ****
(lm-crash-game))
((not lm-game-in-progress)
(message "There is no game in progress"))
! ((y-or-n-p "You mean, you resign ")
(lm-terminate-game 'human-resigned))
! ((y-or-n-p "You mean, we continue ")
(lm-prompt-for-move))
(t
(lm-terminate-game 'human-resigned)))) ; OK. Accept it
--- 811,819 ----
(lm-crash-game))
((not lm-game-in-progress)
(message "There is no game in progress"))
! ((y-or-n-p "You mean, you resign? ")
(lm-terminate-game 'human-resigned))
! ((y-or-n-p "You mean, we continue? ")
(lm-prompt-for-move))
(t
(lm-terminate-game 'human-resigned)))) ; OK. Accept it
***************
*** 823,845 ****
(defun lm-prompt-for-move ()
"Display a message asking for Human's move."
(message (if (zerop lm-number-of-human-moves)
! "Your move ? (move to a free square and hit X, RET ...)"
! "Your move ?"))
;; This may seem silly, but if one omits the following line (or a similar
;; one), the cursor may very well go to some place where POINT is not.
(save-excursion (set-buffer (other-buffer))))
(defun lm-prompt-for-other-game ()
"Ask for another game, and start it."
! (if (y-or-n-p "Another game ")
(if (y-or-n-p "Retain learned weights ")
(lm 2)
(lm 1))
! (message "Chicken !")))
(defun lm-offer-a-draw ()
"Offer a draw and return t if Human accepted it."
! (or (y-or-n-p "I offer you a draw. Do you accept it ")
(not (setq lm-human-refused-draw t))))
--- 823,845 ----
(defun lm-prompt-for-move ()
"Display a message asking for Human's move."
(message (if (zerop lm-number-of-human-moves)
! "Your move? (move to a free square and hit X, RET ...)"
! "Your move?"))
;; This may seem silly, but if one omits the following line (or a similar
;; one), the cursor may very well go to some place where POINT is not.
(save-excursion (set-buffer (other-buffer))))
(defun lm-prompt-for-other-game ()
"Ask for another game, and start it."
! (if (y-or-n-p "Another game? ")
(if (y-or-n-p "Retain learned weights ")
(lm 2)
(lm 1))
! (message "Chicken!")))
(defun lm-offer-a-draw ()
"Offer a draw and return t if Human accepted it."
! (or (y-or-n-p "I offer you a draw. Do you accept it? ")
(not (setq lm-human-refused-draw t))))
***************
*** 1523,1531 ****
(let (square score)
(setq square (lm-point-square))
(cond ((null square)
! (error "Your point is not on a square. Retry !"))
((not (zerop (aref lm-board square)))
! (error "Your point is not on a free square. Retry !"))
(t
(progn
(lm-plot-square square 1)
--- 1523,1531 ----
(let (square score)
(setq square (lm-point-square))
(cond ((null square)
! (error "Your point is not on a square. Retry!"))
((not (zerop (aref lm-board square)))
! (error "Your point is not on a free square. Retry!"))
(t
(progn
(lm-plot-square square 1)
***************
*** 1678,1684 ****
(if (and (> lm-m max-height)
(not (eq lm-m lm-saved-board-height))
;; Use EQ because SAVED-BOARD-HEIGHT may be nil
! (not (y-or-n-p (format "Do you really want %d rows " lm-m))))
(setq lm-m max-height)))
(if lm-one-moment-please
(message "One moment, please..."))
--- 1678,1684 ----
(if (and (> lm-m max-height)
(not (eq lm-m lm-saved-board-height))
;; Use EQ because SAVED-BOARD-HEIGHT may be nil
! (not (y-or-n-p (format "Do you really want %d rows? " lm-m))))
(setq lm-m max-height)))
(if lm-one-moment-please
(message "One moment, please..."))