[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/play/gomoku.el [lexbind]
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/play/gomoku.el [lexbind] |
Date: |
Tue, 14 Oct 2003 19:42:23 -0400 |
Index: emacs/lisp/play/gomoku.el
diff -c emacs/lisp/play/gomoku.el:1.35.2.1 emacs/lisp/play/gomoku.el:1.35.2.2
*** emacs/lisp/play/gomoku.el:1.35.2.1 Fri Apr 4 01:20:31 2003
--- emacs/lisp/play/gomoku.el Tue Oct 14 19:42:16 2003
***************
*** 84,89 ****
--- 84,92 ----
;;; CONSTANTS FOR BOARD
;;;
+ (defconst gomoku-buffer-name "*Gomoku*"
+ "Name of the Gomoku buffer.")
+
;; You may change these values if you have a small screen or if the squares
;; look rectangular, but spacings SHOULD be at least 2 (MUST BE at least 1).
***************
*** 193,200 ****
Other useful commands:
\\{gomoku-mode-map}
Entry to this mode calls the value of `gomoku-mode-hook' if that value
! is non-nil. One interesting value is `turn-on-font-lock'."
(interactive)
(setq major-mode 'gomoku-mode
mode-name "Gomoku")
(gomoku-display-statistics)
--- 196,204 ----
Other useful commands:
\\{gomoku-mode-map}
Entry to this mode calls the value of `gomoku-mode-hook' if that value
! is non-nil."
(interactive)
+ (kill-all-local-variables)
(setq major-mode 'gomoku-mode
mode-name "Gomoku")
(gomoku-display-statistics)
***************
*** 747,753 ****
(interactive (if current-prefix-arg
(list (prefix-numeric-value current-prefix-arg)
(eval (read-minibuffer "Height: ")))))
! (gomoku-switch-to-window)
(cond
(gomoku-emacs-is-computing
(gomoku-crash-game))
--- 751,767 ----
(interactive (if current-prefix-arg
(list (prefix-numeric-value current-prefix-arg)
(eval (read-minibuffer "Height: ")))))
! ;; gomoku-switch-to-window, but without the potential call to gomoku
! ;; from gomoku-prompt-for-other-game.
! (if (get-buffer gomoku-buffer-name)
! (switch-to-buffer gomoku-buffer-name)
! (when gomoku-game-in-progress
! (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
(gomoku-emacs-is-computing
(gomoku-crash-game))
***************
*** 934,940 ****
"Ask for another game, and start it."
(if (y-or-n-p "Another game ")
(gomoku gomoku-board-width gomoku-board-height)
! (message "Chicken !")))
(defun gomoku-offer-a-draw ()
"Offer a draw and return t if Human accepted it."
--- 948,954 ----
"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."
***************
*** 1067,1079 ****
(defun gomoku-switch-to-window ()
"Find or create the Gomoku buffer, and display it."
(interactive)
! (let ((buff (get-buffer "*Gomoku*")))
! (if buff ; Buffer exists:
! (switch-to-buffer buff) ; no problem.
! (if gomoku-game-in-progress
! (gomoku-crash-game)) ; buffer has been killed or something
! (switch-to-buffer "*Gomoku*") ; Anyway, start anew.
! (gomoku-mode))))
;;;
;;; CROSSING WINNING QTUPLES.
--- 1081,1092 ----
(defun gomoku-switch-to-window ()
"Find or create the Gomoku buffer, and display it."
(interactive)
! (if (get-buffer gomoku-buffer-name) ; Buffer exists:
! (switch-to-buffer gomoku-buffer-name) ; no problem.
! (if gomoku-game-in-progress
! (gomoku-crash-game)) ; buffer has been killed or
something
! (switch-to-buffer gomoku-buffer-name) ; Anyway, start anew.
! (gomoku-mode)))
;;;
;;; CROSSING WINNING QTUPLES.
***************
*** 1199,1202 ****
--- 1212,1216 ----
(provide 'gomoku)
+ ;;; arch-tag: b1b8205e-77fc-4597-b373-3ea2c04311eb
;;; gomoku.el ends here
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/play/gomoku.el [lexbind],
Miles Bader <=