/[emacs]/emacs/lisp/play/landmark.el
ViewVC logotype

Diff of /emacs/lisp/play/landmark.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.26 by deego, Sun Sep 18 12:32:51 2005 UTC revision 1.27 by rfrancoise, Sat Sep 24 23:26:26 2005 UTC
# Line 763  If the game is finished, this command re Line 763  If the game is finished, this command re
763      (let (square score)      (let (square score)
764        (setq square (lm-point-square))        (setq square (lm-point-square))
765        (cond ((null square)        (cond ((null square)
766               (error "Your point is not on a square. Retry !"))               (error "Your point is not on a square. Retry!"))
767              ((not (zerop (aref lm-board square)))              ((not (zerop (aref lm-board square)))
768               (error "Your point is not on a free square. Retry !"))               (error "Your point is not on a free square. Retry!"))
769              (t              (t
770               (setq score (aref lm-score-table square))               (setq score (aref lm-score-table square))
771               (lm-play-move square 1)               (lm-play-move square 1)
# Line 790  If the game is finished, this command re Line 790  If the game is finished, this command re
790      (sit-for 4)      (sit-for 4)
791      (lm-prompt-for-other-game))      (lm-prompt-for-other-game))
792     ((zerop lm-number-of-human-moves)     ((zerop lm-number-of-human-moves)
793      (message "You have not played yet... Your move ?"))      (message "You have not played yet... Your move?"))
794     (t     (t
795      (message "One moment, please...")      (message "One moment, please...")
796      ;; It is possible for the user to let Emacs play several consecutive      ;; It is possible for the user to let Emacs play several consecutive
# Line 811  If the game is finished, this command re Line 811  If the game is finished, this command re
811      (lm-crash-game))      (lm-crash-game))
812     ((not lm-game-in-progress)     ((not lm-game-in-progress)
813      (message "There is no game in progress"))      (message "There is no game in progress"))
814     ((y-or-n-p "You mean, you resign ")     ((y-or-n-p "You mean, you resign? ")
815      (lm-terminate-game 'human-resigned))      (lm-terminate-game 'human-resigned))
816     ((y-or-n-p "You mean, we continue ")     ((y-or-n-p "You mean, we continue? ")
817      (lm-prompt-for-move))      (lm-prompt-for-move))
818     (t     (t
819      (lm-terminate-game 'human-resigned)))) ; OK. Accept it      (lm-terminate-game 'human-resigned)))) ; OK. Accept it
# Line 823  If the game is finished, this command re Line 823  If the game is finished, this command re
823  (defun lm-prompt-for-move ()  (defun lm-prompt-for-move ()
824    "Display a message asking for Human's move."    "Display a message asking for Human's move."
825    (message (if (zerop lm-number-of-human-moves)    (message (if (zerop lm-number-of-human-moves)
826                 "Your move ? (move to a free square and hit X, RET ...)"                 "Your move? (move to a free square and hit X, RET ...)"
827                 "Your move ?"))                 "Your move?"))
828    ;; This may seem silly, but if one omits the following line (or a similar    ;; This may seem silly, but if one omits the following line (or a similar
829    ;; one), the cursor may very well go to some place where POINT is not.    ;; one), the cursor may very well go to some place where POINT is not.
830    (save-excursion (set-buffer (other-buffer))))    (save-excursion (set-buffer (other-buffer))))
831    
832  (defun lm-prompt-for-other-game ()  (defun lm-prompt-for-other-game ()
833    "Ask for another game, and start it."    "Ask for another game, and start it."
834    (if (y-or-n-p "Another game ")    (if (y-or-n-p "Another game? ")
835        (if (y-or-n-p "Retain learned weights ")        (if (y-or-n-p "Retain learned weights ")
836            (lm 2)            (lm 2)
837          (lm 1))          (lm 1))
838      (message "Chicken !")))      (message "Chicken!")))
839    
840  (defun lm-offer-a-draw ()  (defun lm-offer-a-draw ()
841    "Offer a draw and return t if Human accepted it."    "Offer a draw and return t if Human accepted it."
842    (or (y-or-n-p "I offer you a draw. Do you accept it ")    (or (y-or-n-p "I offer you a draw. Do you accept it? ")
843        (not (setq lm-human-refused-draw t))))        (not (setq lm-human-refused-draw t))))
844    
845    
# Line 1523  If the game is finished, this command re Line 1523  If the game is finished, this command re
1523      (let (square score)      (let (square score)
1524        (setq square (lm-point-square))        (setq square (lm-point-square))
1525        (cond ((null square)        (cond ((null square)
1526               (error "Your point is not on a square. Retry !"))               (error "Your point is not on a square. Retry!"))
1527              ((not (zerop (aref lm-board square)))              ((not (zerop (aref lm-board square)))
1528               (error "Your point is not on a free square. Retry !"))               (error "Your point is not on a free square. Retry!"))
1529              (t              (t
1530               (progn               (progn
1531                 (lm-plot-square square 1)                 (lm-plot-square square 1)
# Line 1678  Use \\[describe-mode] for more info." Line 1678  Use \\[describe-mode] for more info."
1678        (if (and (> lm-m max-height)        (if (and (> lm-m max-height)
1679                 (not (eq lm-m lm-saved-board-height))                 (not (eq lm-m lm-saved-board-height))
1680                 ;; Use EQ because SAVED-BOARD-HEIGHT may be nil                 ;; Use EQ because SAVED-BOARD-HEIGHT may be nil
1681                 (not (y-or-n-p (format "Do you really want %d rows " lm-m))))                 (not (y-or-n-p (format "Do you really want %d rows? " lm-m))))
1682            (setq lm-m max-height)))            (setq lm-m max-height)))
1683      (if lm-one-moment-please      (if lm-one-moment-please
1684          (message "One moment, please..."))          (message "One moment, please..."))

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26