[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/play/gomoku.el
From: |
Romain Francoise |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/play/gomoku.el |
Date: |
Sat, 24 Sep 2005 19:26:35 -0400 |
Index: emacs/lisp/play/gomoku.el
diff -c emacs/lisp/play/gomoku.el:1.45 emacs/lisp/play/gomoku.el:1.46
*** emacs/lisp/play/gomoku.el:1.45 Mon Aug 15 21:29:32 2005
--- emacs/lisp/play/gomoku.el Sat Sep 24 23:26:27 2005
***************
*** 671,681 ****
(cond ((< gomoku-number-of-moves 20)
"This was a REALLY QUICK win.")
(gomoku-human-refused-draw
! "I won... Too bad you refused my offer of a draw !")
(gomoku-human-took-back
! "I won... Taking moves back will not help you !")
((not gomoku-emacs-played-first)
! "I won... Playing first did not help you much !")
((and (zerop gomoku-number-of-human-wins)
(zerop gomoku-number-of-draws)
(> gomoku-number-of-emacs-wins 1))
--- 671,681 ----
(cond ((< gomoku-number-of-moves 20)
"This was a REALLY QUICK win.")
(gomoku-human-refused-draw
! "I won... Too bad you refused my offer of a draw!")
(gomoku-human-took-back
! "I won... Taking moves back will not help you!")
((not gomoku-emacs-played-first)
! "I won... Playing first did not help you much!")
((and (zerop gomoku-number-of-human-wins)
(zerop gomoku-number-of-draws)
(> gomoku-number-of-emacs-wins 1))
***************
*** 688,694 ****
(gomoku-human-took-back
" I, for one, never take my moves back...")
(gomoku-emacs-played-first
! ".. so what ?")
(" Now, let me play first just once."))))
((eq result 'human-resigned)
(setq gomoku-number-of-emacs-wins (1+ gomoku-number-of-emacs-wins))
--- 688,694 ----
(gomoku-human-took-back
" I, for one, never take my moves back...")
(gomoku-emacs-played-first
! ".. so what?")
(" Now, let me play first just once."))))
((eq result 'human-resigned)
(setq gomoku-number-of-emacs-wins (1+ gomoku-number-of-emacs-wins))
***************
*** 758,764 ****
(setq gomoku-emacs-is-computing nil)
(gomoku-terminate-game 'crash-game)
(sit-for 4)
! (or (y-or-n-p "Another game ") (error "Chicken !")))
(switch-to-buffer gomoku-buffer-name)
(gomoku-mode))
(cond
--- 758,764 ----
(setq gomoku-emacs-is-computing nil)
(gomoku-terminate-game 'crash-game)
(sit-for 4)
! (or (y-or-n-p "Another game? ") (error "Chicken!")))
(switch-to-buffer gomoku-buffer-name)
(gomoku-mode))
(cond
***************
*** 779,792 ****
(if (and (> m max-height)
(not (eq m gomoku-saved-board-height))
;; Use EQ because SAVED-BOARD-HEIGHT may be nil
! (not (y-or-n-p (format "Do you really want %d rows " m))))
(setq m max-height)))
(message "One moment, please...")
(gomoku-start-game n m)
! (if (y-or-n-p "Do you allow me to play first ")
(gomoku-emacs-plays)
(gomoku-prompt-for-move)))
! ((y-or-n-p "Shall we continue our game ")
(gomoku-prompt-for-move))
(t
(gomoku-human-resigns))))
--- 779,792 ----
(if (and (> m max-height)
(not (eq m gomoku-saved-board-height))
;; Use EQ because SAVED-BOARD-HEIGHT may be nil
! (not (y-or-n-p (format "Do you really want %d rows? " m))))
(setq m max-height)))
(message "One moment, please...")
(gomoku-start-game n m)
! (if (y-or-n-p "Do you allow me to play first? ")
(gomoku-emacs-plays)
(gomoku-prompt-for-move)))
! ((y-or-n-p "Shall we continue our game? ")
(gomoku-prompt-for-move))
(t
(gomoku-human-resigns))))
***************
*** 875,883 ****
(let (square score)
(setq square (gomoku-point-square))
(cond ((null square)
! (error "Your point is not on a square. Retry !"))
((not (zerop (aref gomoku-board square)))
! (error "Your point is not on a free square. Retry !"))
(t
(setq score (aref gomoku-score-table square))
(gomoku-play-move square 1)
--- 875,883 ----
(let (square score)
(setq square (gomoku-point-square))
(cond ((null square)
! (error "Your point is not on a square. Retry!"))
((not (zerop (aref gomoku-board square)))
! (error "Your point is not on a free square. Retry!"))
(t
(setq score (aref gomoku-score-table square))
(gomoku-play-move square 1)
***************
*** 902,908 ****
(sit-for 4)
(gomoku-prompt-for-other-game))
((zerop gomoku-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
--- 902,908 ----
(sit-for 4)
(gomoku-prompt-for-other-game))
((zerop gomoku-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
***************
*** 923,931 ****
(gomoku-crash-game))
((not gomoku-game-in-progress)
(message "There is no game in progress"))
! ((y-or-n-p "You mean, you resign ")
(gomoku-terminate-game 'human-resigned))
! ((y-or-n-p "You mean, we continue ")
(gomoku-prompt-for-move))
(t
(gomoku-terminate-game 'human-resigned)))) ; OK. Accept it
--- 923,931 ----
(gomoku-crash-game))
((not gomoku-game-in-progress)
(message "There is no game in progress"))
! ((y-or-n-p "You mean, you resign? ")
(gomoku-terminate-game 'human-resigned))
! ((y-or-n-p "You mean, we continue? ")
(gomoku-prompt-for-move))
(t
(gomoku-terminate-game 'human-resigned)))) ; OK. Accept it
***************
*** 937,957 ****
(defun gomoku-prompt-for-move ()
"Display a message asking for Human's move."
(message (if (zerop gomoku-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 gomoku-prompt-for-other-game ()
"Ask for another game, and start it."
! (if (y-or-n-p "Another game ")
(gomoku gomoku-board-width gomoku-board-height)
! (error "Chicken !")))
(defun gomoku-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 gomoku-human-refused-draw t))))
;;;
--- 937,957 ----
(defun gomoku-prompt-for-move ()
"Display a message asking for Human's move."
(message (if (zerop gomoku-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 gomoku-prompt-for-other-game ()
"Ask for another game, and start it."
! (if (y-or-n-p "Another game? ")
(gomoku gomoku-board-width gomoku-board-height)
! (error "Chicken!")))
(defun gomoku-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 gomoku-human-refused-draw t))))
;;;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/play/gomoku.el,
Romain Francoise <=