comparison lisp/play/gomoku.el @ 30543:cae243d66bbe

(gomoku-font-lock-O-face, gomoku-font-lock-X-face) (gomoku-plot-square, gomoku-init-display): Don't use window-system.
author Eli Zaretskii <eliz@gnu.org>
date Mon, 31 Jul 2000 15:38:35 +0000
parents 8d2bb5d1416a
children 437623e4fe1c
comparison
equal deleted inserted replaced
30542:f03ab02d1f4e 30543:cae243d66bbe
141 141
142 (defvar gomoku-emacs-won () 142 (defvar gomoku-emacs-won ()
143 "For making font-lock use the winner's face for the line.") 143 "For making font-lock use the winner's face for the line.")
144 144
145 (defcustom gomoku-font-lock-O-face 145 (defcustom gomoku-font-lock-O-face
146 (if window-system 146 (if (display-color-p)
147 (list (facemenu-get-face 'fg:red) 'bold)) 147 (list (facemenu-get-face 'fg:red) 'bold))
148 "*Face to use for Emacs' O." 148 "*Face to use for Emacs' O."
149 :type '(repeat face) 149 :type '(repeat face)
150 :group 'gomoku) 150 :group 'gomoku)
151 151
152 (defcustom gomoku-font-lock-X-face 152 (defcustom gomoku-font-lock-X-face
153 (if window-system 153 (if (display-color-p)
154 (list (facemenu-get-face 'fg:green) 'bold)) 154 (list (facemenu-get-face 'fg:green) 'bold))
155 "*Face to use for your X." 155 "*Face to use for your X."
156 :type '(repeat face) 156 :type '(repeat face)
157 :group 'gomoku) 157 :group 'gomoku)
158 158
985 (let ((inhibit-read-only t) 985 (let ((inhibit-read-only t)
986 (inhibit-point-motion-hooks t)) 986 (inhibit-point-motion-hooks t))
987 (insert-and-inherit (cond ((= value 1) ?X) 987 (insert-and-inherit (cond ((= value 1) ?X)
988 ((= value 6) ?O) 988 ((= value 6) ?O)
989 (?.))) 989 (?.)))
990 (and window-system 990 (and (zerop value)
991 (zerop value)
992 (put-text-property (1- (point)) (point) 'mouse-face 'highlight)) 991 (put-text-property (1- (point)) (point) 'mouse-face 'highlight))
993 (delete-char 1) 992 (delete-char 1)
994 (backward-char 1)) 993 (backward-char 1))
995 (sit-for 0)) ; Display NOW 994 (sit-for 0)) ; Display NOW
996 995
1026 (append-to-buffer (current-buffer) opoint (point)) 1025 (append-to-buffer (current-buffer) opoint (point))
1027 (setq i (- i 2))) 1026 (setq i (- i 2)))
1028 (goto-char (point-max)))) 1027 (goto-char (point-max))))
1029 (setq point (point)) 1028 (setq point (point))
1030 (insert ?.) 1029 (insert ?.)
1031 (if window-system 1030 (put-text-property point (point)
1032 (put-text-property point (point) 1031 'mouse-face 'highlight))
1033 'mouse-face 'highlight)))
1034 (> (setq i (1- i)) 0)) 1032 (> (setq i (1- i)) 0))
1035 (if (= i (1- m)) 1033 (if (= i (1- m))
1036 (setq opoint point)) 1034 (setq opoint point))
1037 (insert-char ?\n gomoku-square-height)) 1035 (insert-char ?\n gomoku-square-height))
1038 (or (eq (char-after 1) ?.) 1036 (or (eq (char-after 1) ?.)