comparison lisp/play/gomoku.el @ 923:9f3cc03dae67

entered into RCS
author Jim Blandy <jimb@redhat.com>
date Tue, 04 Aug 1992 04:15:43 +0000
parents 20674ae6bf52
children d5f91623a2cb
comparison
equal deleted inserted replaced
922:52cd80cb5be1 923:9f3cc03dae67
118 (define-key gomoku-mode-map "\C-cp" 'gomoku-human-plays) ; C-C P 118 (define-key gomoku-mode-map "\C-cp" 'gomoku-human-plays) ; C-C P
119 (define-key gomoku-mode-map "\C-cb" 'gomoku-human-takes-back) ; C-C B 119 (define-key gomoku-mode-map "\C-cb" 'gomoku-human-takes-back) ; C-C B
120 (define-key gomoku-mode-map "\C-cr" 'gomoku-human-resigns) ; C-C R 120 (define-key gomoku-mode-map "\C-cr" 'gomoku-human-resigns) ; C-C R
121 (define-key gomoku-mode-map "\C-ce" 'gomoku-emacs-plays) ; C-C E 121 (define-key gomoku-mode-map "\C-ce" 'gomoku-emacs-plays) ; C-C E
122 122
123 ;; Key bindings for "function" keys. If your terminal has such 123 (define-key gomoku-mode-map [up] 'gomoku-move-up)
124 ;; keys, make sure they are declared through the function-keymap 124 (define-key gomoku-mode-map [down] 'gomoku-move-down)
125 ;; keymap (see file keypad.el). 125 (define-key gomoku-mode-map [left] 'gomoku-move-left)
126 ;; One problem with keypad.el is that the function-key-sequence 126 (define-key gomoku-mode-map [right] 'gomoku-move-right)
127 ;; function is really slow, so slow that you may want to comment out 127 (define-key gomoku-mode-map [kp-enter] 'gomoku-human-plays)
128 ;; the following lines ... 128 (define-key gomoku-mode-map [insert] 'gomoku-human-plays))
129 (if (featurep 'keypad)
130 (let (keys)
131 (if (setq keys (function-key-sequence ?u)) ; Up Arrow
132 (define-key gomoku-mode-map keys 'gomoku-move-up))
133 (if (setq keys (function-key-sequence ?d)) ; Down Arrow
134 (define-key gomoku-mode-map keys 'gomoku-move-down))
135 (if (setq keys (function-key-sequence ?l)) ; Left Arrow
136 (define-key gomoku-mode-map keys 'gomoku-move-left))
137 (if (setq keys (function-key-sequence ?r)) ; Right Arrow
138 (define-key gomoku-mode-map keys 'gomoku-move-right))
139 ;; (if (setq keys (function-key-sequence ?e)) ; Enter
140 ;; (define-key gomoku-mode-map keys 'gomoku-human-plays))
141 ;; (if (setq keys (function-key-sequence ?I)) ; Insert
142 ;; (define-key gomoku-mode-map keys 'gomoku-human-plays))
143 )))
144
145
146 129
147 (defun gomoku-mode () 130 (defun gomoku-mode ()
148 "Major mode for playing Gomoku against Emacs. 131 "Major mode for playing Gomoku against Emacs.
149 You and Emacs play in turn by marking a free square. You mark it with X 132 You and Emacs play in turn by marking a free square. You mark it with X
150 and Emacs marks it with O. The winner is the first to get five contiguous 133 and Emacs marks it with O. The winner is the first to get five contiguous