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

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

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

revision 1.35 by lektu, Fri Mar 22 09:43:59 2002 UTC revision 1.35.2.1 by miles, Fri Apr 4 06:20:31 2003 UTC
# Line 1  Line 1 
1  ;;; gomoku.el --- Gomoku game between you and Emacs  ;;; gomoku.el --- Gomoku game between you and Emacs
2    
3  ;; Copyright (C) 1988, 1994, 1996, 2001 Free Software Foundation, Inc.  ;; Copyright (C) 1988, 1994, 1996, 2001, 2003 Free Software Foundation, Inc.
4    
5  ;; Author: Philippe Schnoebelen <phs@lsv.ens-cachan.fr>  ;; Author: Philippe Schnoebelen <phs@lsv.ens-cachan.fr>
6  ;; Maintainer: FSF  ;; Maintainer: FSF
# Line 80  One useful value to include is `turn-on- Line 80  One useful value to include is `turn-on-
80    :type 'hook    :type 'hook
81    :group 'gomoku)    :group 'gomoku)
82    
83  ;;;  ;;;
84  ;;; CONSTANTS FOR BOARD  ;;; CONSTANTS FOR BOARD
85  ;;;  ;;;
86    
# Line 147  One useful value to include is `turn-on- Line 147  One useful value to include is `turn-on-
147    (define-key gomoku-mode-map [mouse-2] 'gomoku-mouse-play)    (define-key gomoku-mode-map [mouse-2] 'gomoku-mouse-play)
148    (define-key gomoku-mode-map [drag-mouse-2] 'gomoku-mouse-play)    (define-key gomoku-mode-map [drag-mouse-2] 'gomoku-mouse-play)
149    
150    (substitute-key-definition 'previous-line 'gomoku-move-up    (define-key gomoku-mode-map [remap previous-line] 'gomoku-move-up)
151                               gomoku-mode-map (current-global-map))    (define-key gomoku-mode-map [remap next-line] 'gomoku-move-down)
152    (substitute-key-definition 'next-line 'gomoku-move-down    (define-key gomoku-mode-map [remap beginning-of-line] 'gomoku-beginning-of-line)
153                               gomoku-mode-map (current-global-map))    (define-key gomoku-mode-map [remap end-of-line] 'gomoku-end-of-line)
154    (substitute-key-definition 'beginning-of-line 'gomoku-beginning-of-line    (define-key gomoku-mode-map [remap undo] 'gomoku-human-takes-back)
155                               gomoku-mode-map (current-global-map))    (define-key gomoku-mode-map [remap advertised-undo] 'gomoku-human-takes-back))
   (substitute-key-definition 'end-of-line 'gomoku-end-of-line  
                              gomoku-mode-map (current-global-map))  
   (substitute-key-definition 'undo 'gomoku-human-takes-back  
                              gomoku-mode-map (current-global-map))  
   (substitute-key-definition 'advertised-undo 'gomoku-human-takes-back  
                              gomoku-mode-map (current-global-map)))  
156    
157  (defvar gomoku-emacs-won ()  (defvar gomoku-emacs-won ()
158    "For making font-lock use the winner's face for the line.")    "For making font-lock use the winner's face for the line.")
# Line 846  Use \\[describe-mode] for more info." Line 840  Use \\[describe-mode] for more info."
840                       gomoku-square-height)                       gomoku-square-height)
841                    1)                    1)
842               gomoku-board-height))))               gomoku-board-height))))
843      
844  (defun gomoku-mouse-play (click)  (defun gomoku-mouse-play (click)
845    "Play at the square where you click."    "Play at the square where you click."
846    (interactive "e")    (interactive "e")
# Line 1156  If the game is finished, this command re Line 1150  If the game is finished, this command re
1150    "Move point down one row on the Gomoku board."    "Move point down one row on the Gomoku board."
1151    (interactive)    (interactive)
1152    (if (< (gomoku-point-y) gomoku-board-height)    (if (< (gomoku-point-y) gomoku-board-height)
1153        (next-line gomoku-square-height)))        (let ((column (current-column)))
1154            (forward-line gomoku-square-height)
1155            (move-to-column column))))
1156    
1157  (defun gomoku-move-up ()  (defun gomoku-move-up ()
1158    "Move point up one row on the Gomoku board."    "Move point up one row on the Gomoku board."
1159    (interactive)    (interactive)
1160    (if (> (gomoku-point-y) 1)    (if (> (gomoku-point-y) 1)
1161        (previous-line gomoku-square-height)))        (let ((column (current-column)))
1162            (forward-line (- 1 gomoku-square-height))
1163            (move-to-column column))))
1164    
1165  (defun gomoku-move-ne ()  (defun gomoku-move-ne ()
1166    "Move point North East on the Gomoku board."    "Move point North East on the Gomoku board."

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.35.2.1

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