MMCT TEAM
Server IP : 111.118.215.189  /  Your IP : 3.128.31.200
Web Server : Apache
System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : a1673wkz ( 2475)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/share/emacs/24.3/lisp/play/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/share/emacs/24.3/lisp/play/gomoku.elc
;ELC
;;; Compiled by mockbuild@buildfarm06-new.corp.cloudlinux.com on Fri Oct 11 10:06:35 2024
;;; from file /builddir/build/BUILD/emacs-24.3/lisp/play/gomoku.el
;;; in Emacs version 24.3.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.

;;; This file does not contain utf-8 non-ASCII characters,
;;; and so can be loaded in Emacs versions earlier than 23.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\300\301\302\303\304\305\306\307&\210\310\311\302\312\313\314\306\301&\207" [custom-declare-group gomoku nil "Gomoku game between you and Emacs." :prefix "gomoku-" :group games custom-declare-variable gomoku-mode-hook "If non-nil, its value is called on entry to Gomoku mode.\nOne useful value to include is `turn-on-font-lock' to highlight the pieces." :type hook] 8)
#@28 Name of the Gomoku buffer.
(defconst gomoku-buffer-name "*Gomoku*" (#$ . 937))
#@57 Horizontal spacing between squares on the Gomoku board.
(defconst gomoku-square-width 4 (#$ . 1022))
#@55 Vertical spacing between squares on the Gomoku board.
(defconst gomoku-square-height 2 (#$ . 1129))
#@72 Number of columns between the Gomoku board and the side of the window.
(defconst gomoku-x-offset 3 (#$ . 1235))
#@69 Number of lines between the Gomoku board and the top of the window.
(defconst gomoku-y-offset 1 (#$ . 1353))
#@37 Local keymap to use in Gomoku mode.
(defvar gomoku-mode-map (byte-code "\301 \302\303\304#\210\302\305\306#\210\302\307\310#\210\302\311\312#\210\302\313\314#\210\302\315\316#\210\302\317\320#\210\302\321\322#\210\302\323\304#\210\302\324\306#\210\302\325\310#\210\302\326\312#\210\302\327\314#\210\302\330\316#\210\302\331\320#\210\302\332\322#\210\302\333\320#\210\302\334\322#\210\302\335\336#\210\302\337\336#\210\302\340\336#\210\302\341\336#\210\302\342\336#\210\302\343\344#\210\302\345\346#\210\302\347\350#\210\302\351\336#\210\302\352\336#\210\302\353\354#\210\302\355\354#\210\302\356\354#\210\302\357\354#\210\302\360\361#\210\302\362\361#\210\302\363\322#\210\302\364\320#\210\302\365\366#\210\302\367\370#\210\302\371\344#\210\302\372\344#\210)\207" [map make-sparse-keymap define-key "y" gomoku-move-nw "u" gomoku-move-ne "b" gomoku-move-sw "n" gomoku-move-se "h" backward-char "l" forward-char "j" gomoku-move-down "k" gomoku-move-up [kp-7] [kp-9] [kp-1] [kp-3] [kp-4] [kp-6] [kp-2] [kp-8] "" "" "X" gomoku-human-plays "x" " " "
" "" "" gomoku-human-takes-back "" gomoku-human-resigns "" gomoku-emacs-plays [kp-enter] [insert] [down-mouse-1] gomoku-click [drag-mouse-1] [mouse-1] [down-mouse-2] [mouse-2] gomoku-mouse-play [drag-mouse-2] [remap previous-line] [remap next-line] [remap move-beginning-of-line] gomoku-beginning-of-line [remap move-end-of-line] gomoku-end-of-line [remap undo] [remap advertised-undo]] 4) (#$ . 1468))
#@58 For making font-lock use the winner's face for the line.
(defvar gomoku-emacs-won nil (#$ . 2974))
(byte-code "\300\301\302\303\304\305%\210\300\306\307\310\304\305%\207" [custom-declare-face gomoku-O ((((class color)) (:foreground "red" :weight bold))) "Face to use for Emacs's O." :group gomoku gomoku-X ((((class color)) (:foreground "green" :weight bold))) "Face to use for your X."] 6)
#@29 Font lock rules for Gomoku.
(defvar gomoku-font-lock-keywords '(("O" quote gomoku-O) ("X" quote gomoku-X) ("[-|/\\]" 0 (if gomoku-emacs-won 'gomoku-O 'gomoku-X))) (#$ . 3371))
(byte-code "\300\301\302\300\301\303\304##\210\300\301\305\306#\210\300\301\307\310#\210\311\312N\204$\300\311\312\313\314!#\210\315\316!\2040\300\316\317\301#\210\300\207" [put gomoku-mode front-sticky rear-nonsticky (intangible) intangible 1 mode-class special gomoku-mode-hook variable-documentation purecopy "Hook run when entering Gomoku mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it.  (This is true for all hook variables.)" boundp gomoku-mode-map definition-name] 7)
(defvar gomoku-mode-map (make-sparse-keymap))
(byte-code "\300\301N\204\302\300\301\303\304!#\210\305\306!\204\302\306\307\310#\210\300\207" [gomoku-mode-map variable-documentation put purecopy "Keymap for `gomoku-mode'." boundp gomoku-mode-syntax-table definition-name gomoku-mode] 5)
(defvar gomoku-mode-syntax-table (make-syntax-table))
(byte-code "\300\301N\204\302\300\301\303\304!#\210\302\305\306\307#\207" [gomoku-mode-syntax-table variable-documentation put purecopy "Syntax table for `gomoku-mode'." gomoku-mode-abbrev-table definition-name gomoku-mode] 5)
(defvar gomoku-mode-abbrev-table (progn (define-abbrev-table 'gomoku-mode-abbrev-table nil) gomoku-mode-abbrev-table))
(byte-code "\300\301N\204\302\300\301\303\304!#\210\302\305\306\307#\207" [gomoku-mode-abbrev-table variable-documentation put purecopy "Abbrev table for `gomoku-mode'." gomoku-mode derived-mode-parent nil] 5)
#@482 Major mode for playing Gomoku against Emacs.
You and Emacs play in turn by marking a free square.  You mark it with X
and Emacs marks it with O.  The winner is the first to get five contiguous
marks horizontally, vertically or in diagonal.
\<gomoku-mode-map>
You play by moving the cursor over the square you choose and hitting \[gomoku-human-plays].

Other useful commands:

\{gomoku-mode-map}

This mode runs the hook `gomoku-mode-hook', as the final step
during initialization.
(defalias 'gomoku-mode #[nil "\306\300!\210\307\310 \210\311\312\313!\210\314\f!\210
\315 \210\306\316!\210\317\307)\320\321!\207" [delay-mode-hooks major-mode mode-name gomoku-mode-map gomoku-mode-syntax-table gomoku-mode-abbrev-table make-local-variable t kill-all-local-variables gomoku-mode "Gomoku" use-local-map set-syntax-table gomoku-display-statistics font-lock-defaults (gomoku-font-lock-keywords t) run-mode-hooks gomoku-mode-hook local-abbrev-table buffer-read-only] 2 (#$ . 4980) nil])
#@40 Number of columns on the Gomoku board.
(defvar gomoku-board-width nil (#$ . 5976))
#@38 Number of lines on the Gomoku board.
(defvar gomoku-board-height nil (#$ . 6065))
#@56 Vector recording the actual state of the Gomoku board.
(defvar gomoku-board nil (#$ . 6153))
#@34 Length of `gomoku-board' vector.
(defvar gomoku-vector-length nil (#$ . 6252))
#@47 After how many moves will Emacs offer a draw?
(defvar gomoku-draw-limit nil (#$ . 6337))
#@69 Translate X, Y cartesian coords into the corresponding board index.
(defalias 'gomoku-xy-to-index #[(x y) "\303	_\n#\207" [y gomoku-board-width x +] 4 (#$ . 6432)])
#@46 Return corresponding x-coord of board INDEX.
(defalias 'gomoku-index-to-x #[(index) "	T\246\207" [index gomoku-board-width] 2 (#$ . 6605)])
#@46 Return corresponding y-coord of board INDEX.
(defalias 'gomoku-index-to-y #[(index) "	T\245\207" [index gomoku-board-width] 2 (#$ . 6752)])
#@67 Create the `gomoku-board' vector and fill it with initial values.
(defalias 'gomoku-init-board #[nil "\305\306\"\306S\fX\203#	\307I\210	\n\307I\210T\nS\202\n*\306\211W\205;	\307I\210\310\f\311#\211\202')\207" [gomoku-vector-length gomoku-board ii i gomoku-board-width make-vector 0 -1 + 1] 5 (#$ . 6899)])
#@56 Vector recording the actual score of the free squares.
(defvar gomoku-score-table nil (#$ . 7230))
#@27 Score of an empty qtuple.
(defconst gomoku-nil-score 7 (#$ . 7335))
#@37 Score of a qtuple containing one X.
(defconst gomoku-Xscore 15 (#$ . 7409))
#@39 Score of a qtuple containing two X's.
(defconst gomoku-XXscore 400 (#$ . 7491))
#@41 Score of a qtuple containing three X's.
(defconst gomoku-XXXscore 1800 (#$ . 7577))
#@40 Score of a qtuple containing four X's.
(defconst gomoku-XXXXscore 100000 (#$ . 7667))
#@37 Score of a qtuple containing one O.
(defconst gomoku-Oscore 35 (#$ . 7759))
#@39 Score of a qtuple containing two O's.
(defconst gomoku-OOscore 800 (#$ . 7841))
#@41 Score of a qtuple containing three O's.
(defconst gomoku-OOOscore 15000 (#$ . 7927))
#@40 Score of a qtuple containing four O's.
(defconst gomoku-OOOOscore 800000 (#$ . 8018))
#@52 Vector associating qtuple contents to their score.
(defconst gomoku-score-trans-table (byte-code "\306	\n\f\307
\307\211\211\211\211\307\211\211\211\211	\307\211\211\211\211\n\307\211\211\211\211\211&\207" [gomoku-nil-score gomoku-Xscore gomoku-XXscore gomoku-XXXscore gomoku-XXXXscore gomoku-Oscore vector 0 gomoku-OOscore gomoku-OOOscore gomoku-OOOOscore] 32) (#$ . 8110))
#@56 Threshold score beyond which an Emacs move is winning.
(defconst gomoku-winning-threshold gomoku-OOOOscore (#$ . 8498))
#@55 Threshold score beyond which a human move is winning.
(defconst gomoku-losing-threshold gomoku-XXXXscore (#$ . 8624))
#@66 Compute index of free square with highest score, or nil if none.
(defalias 'gomoku-strongest-square #[nil "\306\211\307\310\211\"\307	\"\311\211

\fX\203x
HW\204q
H\211V\203M\312
H!\203D\310

\n\202q
\313I\210\202q\312
H!\204_
\313I\210\202q\312\314
T\211
!!\203q
\n
T\211\202.\207" [gomoku-board-width gomoku-board-height score best-square end square 0 gomoku-xy-to-index 1 nil zerop -1 random count score-max gomoku-score-table gomoku-board] 7 (#$ . 8748)])
#@49 Recorded initial value of previous score table.
(defvar gomoku-saved-score-table nil (#$ . 9262))
#@41 Recorded value of previous board width.
(defvar gomoku-saved-board-width nil (#$ . 9366))
#@42 Recorded value of previous board height.
(defvar gomoku-saved-board-height nil (#$ . 9462))
#@64 Create the score table vector and fill it with initial values.
(defalias 'gomoku-init-score-table #[nil "\203	\nU\203\fU\203\306!\211\207\307\310_\"\311\211\211\211\211\211	T\312\245T\312\245\313^\313^\314\211X\203v\314\211X\203m\315\"\210T\211\202WT\211\202MX\203\241\314\211X\203\230\315\"\210T\211\202\202T\211\202x.\306
!	\211\207" [gomoku-saved-score-table gomoku-board-width gomoku-saved-board-width gomoku-board-height gomoku-saved-board-height gomoku-score-table copy-sequence make-vector 20 nil 2 4 1 gomoku-init-square-score gomoku-vector-length gomoku-nil-score maxj2 maxi2 maxj maxi j i] 7 (#$ . 9560)])
#@53 Return the number of qtuples containing square I,J.
(defalias 'gomoku-nb-qtuples #[(i j) "\306S^\306	Z^\306\nS^\306\nZ^\f\307\310\f\\\311]\312^
\f\\\311]\312^\f
^\f^\\\311]\312^
^\f\f^\\\311]\312^%,\207" [i gomoku-board-width j gomoku-board-height down up 4 + -12 3 8 right left] 8 (#$ . 10275)])
#@60 Give initial score to square I,J and to its mirror images.
(defalias 'gomoku-init-square-score #[(i j) "	ZT\nZT\306	\"\f\307H_	\n\310	\"
I\210\310\n\"
I\210\310		\"
I\210\310\n	\"
I+\207" [gomoku-board-width i gomoku-board-height j gomoku-score-trans-table sc gomoku-nb-qtuples 0 gomoku-xy-to-index jj ii gomoku-score-table] 5 (#$ . 10595)])
#@60 Update score table after SQUARE received a DVAL increment.
(defalias 'gomoku-update-score-table #[(square dval) "\306!\307!\310\311	Z]\310\311\nZ]\312\313
	\314#^\312\313\n\314#^\315\311\312&\210\315\f\312\311&\210\315\f]^\311\211&\210\315\311\nZ\310]	
Z]\312	\316Z^\313\n\314#^\317\311&.\207" [square x y imin jmin gomoku-board-width gomoku-index-to-x gomoku-index-to-y -4 1 0 - 4 gomoku-update-score-in-direction 5 -1 imax gomoku-board-height jmax dval] 7 (#$ . 10963)])
#@187 Update scores for all squares in the qtuples starting between the LEFTth
square and the RIGHTth after SQUARE, along the DX, DY direction, considering
that DVAL has been added on SQUARE.
(defalias 'gomoku-update-score-in-direction #[(left right square dx dy dval) "	V\206\273\306\211\211\211\211\211\f
\307\"

_\\\f	
_\\\f
\310_\\\f\311\fX\203UH\\
\\\211\202=\f
X\205\271HZHZ\312\n!\204\233\f\211\fX\203\233\312H!\203\220H\n\\I\210
\\\211\202t\f
\\\313\fH[\fH#\f
\\\211\f\202W.\207" [left right delta count square2 square1 nil gomoku-xy-to-index 4 0 zerop + square0 depl dx dy square gomoku-board gomoku-score-trans-table dval gomoku-score-table] 7 (#$ . 11484)])
#@35 Non-nil if a game is in progress.
(defvar gomoku-game-in-progress nil (#$ . 12246))
#@66 A record of all moves that have been played during current game.
(defvar gomoku-game-history nil (#$ . 12336))
#@49 Number of moves already played in current game.
(defvar gomoku-number-of-moves nil (#$ . 12453))
#@58 Number of moves already played by human in current game.
(defvar gomoku-number-of-human-moves nil (#$ . 12556))
#@32 Non-nil if Emacs played first.
(defvar gomoku-emacs-played-first nil (#$ . 12674))
#@52 Non-nil if Human took back a move during the game.
(defvar gomoku-human-took-back nil (#$ . 12763))
#@49 Non-nil if Human refused Emacs offer of a draw.
(defvar gomoku-human-refused-draw nil (#$ . 12869))
#@53 Non-nil if Emacs is in the middle of a computation.
(defvar gomoku-emacs-is-computing nil (#$ . 12975))
#@43 Initialize a new game on an N by M board.
(defalias 'gomoku-start-game #[(n m) "\306\211\n\f\f\307\\\nT_T\310\n\f\311#\312\245\313\211\314\211\313\211\313\315\n\f\"\210\316 \210\317 \210\313\211\207" [gomoku-emacs-is-computing gomoku-game-in-progress n gomoku-board-width m gomoku-board-height t 2 * 7 10 nil 0 gomoku-init-display gomoku-init-score-table gomoku-init-board gomoku-vector-length gomoku-draw-limit gomoku-emacs-won gomoku-game-history gomoku-number-of-moves gomoku-number-of-human-moves gomoku-emacs-played-first gomoku-human-took-back gomoku-human-refused-draw] 5 (#$ . 13085)])
#@47 Go to SQUARE, play VAL and update everything.
(defalias 'gomoku-play-move #[(square val &optional dont-update-score) "\306	\307U\203\nT\202\310!\203\306


HBBT\311
	\"\210
	I\210\204?\312
	\"\210

\313I\210\314\211\207" [gomoku-emacs-is-computing val gomoku-number-of-human-moves gomoku-number-of-moves gomoku-emacs-played-first square t 1 zerop gomoku-plot-square gomoku-update-score-table -1 nil gomoku-score-table gomoku-game-history gomoku-board dont-update-score] 3 (#$ . 13708)])
#@44 Take back last move and update everything.
(defalias 'gomoku-take-back #[nil "\306	@\211@\fH\211\307U\203\fS\f	A
S
\310\311\"\210\f\311I\210\312
[\"\210\nAI\210+\313\211\207" [gomoku-emacs-is-computing gomoku-game-history last-move square gomoku-board oldval t 1 gomoku-plot-square 0 gomoku-update-score-table nil gomoku-number-of-human-moves gomoku-number-of-moves gomoku-score-table] 4 (#$ . 14224)])
#@44 Number of games Emacs won in this session.
(defvar gomoku-number-of-emacs-wins 0 (#$ . 14652))
#@42 Number of games you won in this session.
(defvar gomoku-number-of-human-wins 0 (#$ . 14753))
#@48 Number of games already drawn in this session.
(defvar gomoku-number-of-draws 0 (#$ . 14852))
#@41 Terminate the current game with RESULT.
(defalias 'gomoku-terminate-game #[(result) "\306\307=\203H	T\n\310W\203\311\202\277\203\312\202\277\f\203$\313\202\277
\204,\314\202\277\315$!\203D\315%!\203D	\316V\203D\317\202\277\320\202\277\321=\203i$T$\322\f\203\\\323\202e
\203d\324\202e\325P\202\277\326=\203v	T\327\202\277\330=\203\227%T%\331\f\203\212\332\202\223
\203\222\333\202\223\334P\202\277\335=\203\270%T%\336\f\203\253\332\202\264
\203\263\337\202\264\334P\202\277\340=\205\277\341!\210\342 \210\343\211&\207" [result gomoku-number-of-emacs-wins gomoku-number-of-moves gomoku-human-refused-draw gomoku-human-took-back gomoku-emacs-played-first message emacs-won 20 "This was a REALLY QUICK win." "I won...  Too bad you refused my offer of a draw!" "I won...  Taking moves back will not help you!" "I won...  Playing first did not help you much!" zerop 1 "I'm becoming tired of winning..." "I won." human-won "OK, you won this one." "  I, for one, never take my moves back..." ".. so what?" "  Now, let me play first just once." human-resigned "So you resign.  That's just one more win for me." nobody-won "This is a draw.  " "I, for one, never take my moves back..." "Just chance, I guess." "Now, let me play first just once." draw-agreed "Draw agreed.  " "You were lucky." crash-game "Sorry, I have been interrupted and cannot resume that game..." gomoku-display-statistics nil gomoku-number-of-human-wins gomoku-number-of-draws gomoku-game-in-progress] 3 (#$ . 14952)])
#@56 What to do when Emacs detects it has been interrupted.
(defalias 'gomoku-crash-game #[nil "\301\302\303!\210\304\305!\210\306 \207" [gomoku-emacs-is-computing nil gomoku-terminate-game crash-game sit-for 4 gomoku-prompt-for-other-game] 2 (#$ . 16493)])
#@704 Start a Gomoku game between you and Emacs.

If a game is in progress, this command allows you to resume it.
If optional arguments N and M are given, an N by M board is used.
If prefix arg is given for N, M is prompted for.

You and Emacs play in turn by marking a free square.  You mark it with X
and Emacs marks it with O.  The winner is the first to get five contiguous
marks horizontally, vertically or in diagonal.

You play by moving the cursor over the square you choose and hitting
\<gomoku-mode-map>\[gomoku-human-plays].

This program actually plays a simplified or archaic version of the
Gomoku game, and ought to be upgraded to use the full modern rules.

Use \[describe-mode] for more info.
(defalias 'gomoku #[(&optional n m) "\306!\203
\307!\210\202,	\203%\310\311\312!\210\313\314!\210\315\316!\204%\317\320!\210\307!\210\321 \210\n\2033\322 \207	\203=\323X\203\260\324 \325 $\204K
$%\204S\f%$\326W\203a\317\327!\210\202|%\326W\203o\317\330!\210\202|$
V\203|\317\331$\"\210%\fV\203\230%&=\204\230\315\332\333%\"!\204\230\f%*\334\335!\210\336$%\"\210\315\337!\203\255\340 \207\341 \207\315\342!\203\271\341 \207\343 \207" [gomoku-buffer-name gomoku-game-in-progress gomoku-emacs-is-computing gomoku-number-of-moves max-height max-width get-buffer switch-to-buffer nil gomoku-terminate-game crash-game sit-for 4 y-or-n-p "Another game? " error "Chicken!" gomoku-mode gomoku-crash-game 2 gomoku-max-width gomoku-max-height 1 "I need at least 1 column" "I need at least 1 row" "I cannot display %d columns in that window" format "Do you really want %d rows? " message "One moment, please..." gomoku-start-game "Do you allow me to play first? " gomoku-emacs-plays gomoku-prompt-for-move "Shall we continue our game? " gomoku-human-resigns n m gomoku-saved-board-height] 4 (#$ . 16754) (byte-code "\205
\301!\302\303\304!!D\207" [current-prefix-arg prefix-numeric-value eval read-minibuffer "Height: "] 4)])
#@38 Compute Emacs next move and play it.
(defalias 'gomoku-emacs-plays #[nil "\306 \210\203\n\307 \207	\204\310 \207\311\312!\210\313\211\314 \211\204&\315\316!\202i\fH\317\320\"\210\n
Y\203C\321\322\320\"\210\315\323!\202i\324\n!\203O\315\316!\202iV\203g\204g\325 \203g\315\326!\202i\327 *\207" [gomoku-emacs-is-computing gomoku-game-in-progress score square gomoku-score-table gomoku-winning-threshold gomoku-switch-to-window gomoku-crash-game gomoku-prompt-for-other-game message "Let me think..." nil gomoku-strongest-square gomoku-terminate-game nobody-won gomoku-play-move 6 t gomoku-find-filled-qtuple emacs-won zerop gomoku-offer-a-draw draw-agreed gomoku-prompt-for-move gomoku-emacs-won gomoku-number-of-moves gomoku-draw-limit gomoku-human-refused-draw] 4 (#$ . 18721) nil])
#@41 Position at the square where you click.
(defalias 'gomoku-click #[(click) "\306\307!\211\211@)!\205y\310	8\206'	A@:\203$	A@@\202'	A@)\247\205y\311\211@)!\205y\312!\211\205y\313\314\315@\n\316#\317 \211\320\246\320\245%\245\316]\f^\314\315A
\316#\321\322\316\323 \")\211\320\246\320\245%\245\316]^\"\207" [click position gomoku-x-offset gomoku-square-width gomoku-board-width gomoku-y-offset windowp event-end 5 select-window posn-col-row gomoku-goto-xy + - 1 window-hscroll 2 t count-lines window-start inhibit-point-motion-hooks gomoku-square-height gomoku-board-height] 10 (#$ . 19538) "e"])
#@37 Play at the square where you click.
(defalias 'gomoku-mouse-play #[(click) "\301!\205\302 \207" [click gomoku-click gomoku-human-plays] 2 (#$ . 20169) "e"])
#@184 Signal to the Gomoku program that you have played.
You must have put the cursor on the square where you want to play.
If the game is finished, this command requests for another game.
(defalias 'gomoku-human-plays #[nil "\306 \210\203\n\307 \207	\204\310 \207\311\211\312 \211\204\"\313\314!\202O\315\fH!\2040\313\316!\202O
H\317\320\"\210\nY\203M\321\320\"\203M\322\323!\202O\324 *\207" [gomoku-emacs-is-computing gomoku-game-in-progress score square gomoku-board gomoku-score-table gomoku-switch-to-window gomoku-crash-game gomoku-prompt-for-other-game nil gomoku-point-square error "Your point is not on a square.  Retry!" zerop "Your point is not on a free square.  Retry!" gomoku-play-move 1 gomoku-find-filled-qtuple gomoku-terminate-game human-won gomoku-emacs-plays gomoku-losing-threshold] 4 (#$ . 20336) nil])
#@73 Signal to the Gomoku program that you wish to take back your last move.
(defalias 'gomoku-human-takes-back #[nil "\305 \210\203\n\306 \207	\204\307\310!\210\311\312!\210\313 \207\314\n!\203#\307\315!\207\307\316!\210\317\n\f\nU\2037\320 \210\202+)\321 \207" [gomoku-emacs-is-computing gomoku-game-in-progress gomoku-number-of-human-moves gomoku-human-took-back number gomoku-switch-to-window gomoku-crash-game message "Too late for taking back..." sit-for 4 gomoku-prompt-for-other-game zerop "You have not played yet...  Your move?" "One moment, please..." t gomoku-take-back gomoku-prompt-for-move] 2 (#$ . 21182) nil])
#@59 Signal to the Gomoku program that you may want to resign.
(defalias 'gomoku-human-resigns #[nil "\302 \210\203\n\303 \207	\204\304\305!\207\306\307!\203\310\311!\207\306\312!\203%\313 \207\310\311!\207" [gomoku-emacs-is-computing gomoku-game-in-progress gomoku-switch-to-window gomoku-crash-game message "There is no game in progress" y-or-n-p "You mean, you resign? " gomoku-terminate-game human-resigned "You mean, we continue? " gomoku-prompt-for-move] 2 (#$ . 21819) nil])
#@44 Display a message asking for Human's move.
(defalias 'gomoku-prompt-for-move #[nil "\301\302!\203\303\202\f\304!\207" [gomoku-number-of-human-moves message zerop "Your move?  (Move to a free square and hit X, RET ...)" "Your move?"] 3 (#$ . 22309)])
#@37 Ask for another game, and start it.
(defalias 'gomoku-prompt-for-other-game #[nil "\302\303!\203\304	\"\207\305\306!\207" [gomoku-board-width gomoku-board-height y-or-n-p "Another game? " gomoku error "Chicken!"] 3 (#$ . 22569)])
#@49 Offer a draw and return t if Human accepted it.
(defalias 'gomoku-offer-a-draw #[nil "\301\302!\206\n\303\211?\207" [gomoku-human-refused-draw y-or-n-p "I offer you a draw.  Do you accept it? " t] 2 (#$ . 22808)])
#@54 Largest possible board width for the current window.
(defalias 'gomoku-max-width #[nil "\302\303\304 !\211\305$	\245T\207" [gomoku-x-offset gomoku-square-width - window-width selected-window 1] 5 (#$ . 23030)])
#@55 Largest possible board height for the current window.
(defalias 'gomoku-max-height #[nil "\302\303\304 !\211\305$	\245T\207" [gomoku-y-offset gomoku-square-height - window-height selected-window 2] 5 (#$ . 23248)])
#@38 Return the board row where point is.
(defalias 'gomoku-point-y #[nil "\303\304\305\306`\"	n\203\307\202\306#\n\245T)\207" [inhibit-point-motion-hooks gomoku-y-offset gomoku-square-height t - count-lines 1 0] 4 (#$ . 23470)])
#@45 Return the index of the square point is on.
(defalias 'gomoku-point-square #[nil "\303\304i	Z\n\245T\305 \")\207" [inhibit-point-motion-hooks gomoku-x-offset gomoku-square-width t gomoku-xy-to-index gomoku-point-y] 3 (#$ . 23706)])
#@36 Move point to square number INDEX.
(defalias 'gomoku-goto-square #[(index) "\301\302!\303!\"\207" [index gomoku-goto-xy gomoku-index-to-x gomoku-index-to-y] 4 (#$ . 23945)])
#@38 Move point to square at X, Y coords.
(defalias 'gomoku-goto-xy #[(x y) "\306eb\210	\nS_\\y\210)\307\f
S_\\!\207" [inhibit-point-motion-hooks gomoku-y-offset gomoku-square-height y gomoku-x-offset gomoku-square-width t move-to-column x] 4 (#$ . 24127)])
#@71 Draw 'X', 'O' or '.' on SQUARE depending on VALUE, leave point there.
(defalias 'gomoku-plot-square #[(square value) "\304U\204\n\305	!\210\306\211\307\304U\203\310\202$\311U\203#\312\202$\313!\210\314!\2033\315`S`\316#\210\317\304!\210\320u\210*\321\322!\207" [value square inhibit-point-motion-hooks inhibit-read-only 1 gomoku-goto-square t insert-and-inherit 88 6 79 46 zerop add-text-properties (mouse-face highlight help-echo "mouse-2: play at this square") delete-char -1 sit-for 0] 4 (#$ . 24390)])
#@33 Display an N by M Gomoku board.
(defalias 'gomoku-init-display #[(n m) "\306p!\210\307\310\311\307\311\211!\"\312#$\246!\203#$\2021\313#$\246$\310#\314\245\314]%\315 \210\316&!\210'#$Z\nS\211\317Y\203\247\320\321	$\\\211iZ%\245\"\210\320\322	iZ\"\210\f?\211\203r\323!`\304\314$\210\312\n!\203\227\314ZU\203\227\324Y\203\224\325p
`#\210\314Z\211\202\201db\210`!\326c\210\327!`\330#\210\202DS\211\317V\203\303SU\203\272!\320\331(\"\210\202;\310f\326=\204\321\323\310\314\332\333$\210\f\204\335\323!`\304\314$\210\323!`\332\334$\210\323e`\335\336$\210.\337'T\314\245T\314\245\"\210\340\317!\207" [m x j i intangible opoint buffer-disable-undo t 1 nil zerop + 2 erase-buffer newline 0 insert-char 9 32 put-text-property 3 append-to-buffer 46 add-text-properties (mouse-face highlight help-echo "mouse-2: play at this square") 10 point-entered #[(_x _y) "o\205\300u\207" [nil] 1] #[(_x _y) "m\205\300u\207" [-1] 1] category gomoku-mode gomoku-goto-xy sit-for point inhibit-read-only gomoku-x-offset gomoku-square-width tab-width gomoku-y-offset n gomoku-square-height] 8 (#$ . 24915)])
#@72 Obnoxiously display some statistics about previous games in mode line.
(defalias 'gomoku-display-statistics #[nil "\305 \230\205\306\307	\n\310!\203\311\202\306\312\"$\313 \207" [gomoku-buffer-name gomoku-number-of-human-wins gomoku-number-of-emacs-wins gomoku-number-of-draws mode-line-process buffer-name format ": won %d, lost %d%s" zerop "" ", drew %d" force-mode-line-update] 7 (#$ . 26066)])
#@51 Find or create the Gomoku buffer, and display it.
(defalias 'gomoku-switch-to-window #[nil "\302!\203\n\303!\207	\203\304 \210\303!\210\305 \207" [gomoku-buffer-name gomoku-game-in-progress get-buffer switch-to-buffer gomoku-crash-game gomoku-mode] 2 (#$ . 26480) nil])
#@60 Return t if SQUARE belongs to a qtuple filled with VALUEs.
(defalias 'gomoku-find-filled-qtuple #[(square value) "\302	\303\304$\206!\302	\304\303$\206!\302	\303\211$\206!\302	\305\303$\207" [square value gomoku-check-filled-qtuple 1 0 -1] 5 (#$ . 26762)])
#@74 Return t if SQUARE belongs to a qtuple filled  with VALUEs along DX, DY.
(defalias 'gomoku-check-filled-qtuple #[(square value dx dy) "\306\211\211\307	\n\"\f\211
\310V\203,
Z\211HU\203,
S\211
\202\f
\311\\W\203M\f\\\211HU\203M\fT\211\f\202.\f
\311\\U\205i\312
_\\\f_\\	\n$\210\313-\207" [square dx dy depl right left 0 gomoku-xy-to-index -4 4 gomoku-cross-qtuple t b a value gomoku-board] 8 (#$ . 27032)])
#@73 Cross every square between SQUARE1 and SQUARE2 in the DX, DY direction.
(defalias 'gomoku-cross-qtuple #[(square1 square2 dx dy) "\212\306	\"\307\211
U\204\220\310
!\210
\f\\	\311U\2035\312u\210\313\314S\307#\210`\315\316w\210`|\210\202\n\311U\203`\312iW\203\\T\312y\210j\210\317\320!\210\202A*\202\n\321U\203{i\322\245Z\322\245y\210j\210\317\323!\210\202\ni\322\245\\\322\245y\210j\210\317\324!\210\202\n,\325\311!\207" [dx dy inhibit-point-motion-hooks inhibit-read-only depl square1 gomoku-xy-to-index t gomoku-goto-square 0 1 insert-char 45 " 	" nil insert-and-inherit 124 -1 2 47 92 sit-for square2 gomoku-square-width column n gomoku-square-height] 4 (#$ . 27485)])
#@46 Move point down one row on the Gomoku board.
(defalias 'gomoku-move-down #[nil "\303 W\205i\ny\210\304	!)\207" [gomoku-board-height column gomoku-square-height gomoku-point-y move-to-column] 2 (#$ . 28206) nil])
#@44 Move point up one row on the Gomoku board.
(defalias 'gomoku-move-up #[nil "\302 \303V\205i\303	Zy\210\304!)\207" [column gomoku-square-height gomoku-point-y 1 move-to-column] 2 (#$ . 28428) nil])
#@44 Move point North East on the Gomoku board.
(defalias 'gomoku-move-ne #[nil "\300 \210\301u\207" [gomoku-move-up nil] 1 (#$ . 28635) nil])
#@44 Move point South East on the Gomoku board.
(defalias 'gomoku-move-se #[nil "\300 \210\301u\207" [gomoku-move-down nil] 1 (#$ . 28779) nil])
#@44 Move point North West on the Gomoku board.
(defalias 'gomoku-move-nw #[nil "\300 \210\301u\207" [gomoku-move-up -1] 1 (#$ . 28925) nil])
#@44 Move point South West on the Gomoku board.
(defalias 'gomoku-move-sw #[nil "\300 \210\301u\207" [gomoku-move-down -1] 1 (#$ . 29068) nil])
#@53 Move point to first square on the Gomoku board row.
(defalias 'gomoku-beginning-of-line #[nil "\301!\207" [gomoku-x-offset move-to-column] 2 (#$ . 29213) nil])
#@52 Move point to last square on the Gomoku board row.
(defalias 'gomoku-end-of-line #[nil "\303	\nS_\\!\207" [gomoku-x-offset gomoku-square-width gomoku-board-width move-to-column] 4 (#$ . 29380) nil])
(provide 'gomoku)

MMCT - 2023