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/landmark.elc
;ELC
;;; Compiled by mockbuild@buildfarm06-new.corp.cloudlinux.com on Fri Oct 11 10:06:36 2024
;;; from file /builddir/build/BUILD/emacs-24.3/lisp/play/landmark.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.

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


(custom-declare-group 'landmark nil "Neural-network robot that learns landmarks." :prefix "landmark-" :group 'games)
#@42 Number of columns on the Landmark board.
(defvar landmark-board-width nil (#$ . 673))
#@40 Number of lines on the Landmark board.
(defvar landmark-board-height nil (#$ . 765))
#@58 Vector recording the actual state of the Landmark board.
(defvar landmark-board nil (#$ . 856))
#@34 Length of landmark-board vector.
(defvar landmark-vector-length nil (#$ . 958))
#@47 After how many moves will Emacs offer a draw?
(defvar landmark-draw-limit nil (#$ . 1044))
#@54 This is the x coordinate of the center of the board.
(defvar landmark-cx 0 (#$ . 1141))
#@54 This is the y coordinate of the center of the board.
(defvar landmark-cy 0 (#$ . 1235))
#@47 This is the x dimension of the playing board.
(defvar landmark-m 0 (#$ . 1329))
#@47 This is the y dimension of the playing board.
(defvar landmark-n 0 (#$ . 1415))
#@69 Translate X, Y cartesian coords into the corresponding board index.
(defalias 'landmark-xy-to-index #[(x y) "\303	_\n#\207" [y landmark-board-width x +] 4 (#$ . 1501)])
#@46 Return corresponding x-coord of board INDEX.
(defalias 'landmark-index-to-x #[(index) "	T\246\207" [index landmark-board-width] 2 (#$ . 1678)])
#@46 Return corresponding y-coord of board INDEX.
(defalias 'landmark-index-to-y #[(index) "	T\245\207" [index landmark-board-width] 2 (#$ . 1829)])
#@67 Create the landmark-board vector and fill it with initial values.
(defalias 'landmark-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" [landmark-vector-length landmark-board ii i landmark-board-width make-vector 0 -1 + 1] 5 (#$ . 1980)])
#@59 Horizontal spacing between squares on the Landmark board.
(defconst landmark-square-width 2 (#$ . 2319))
#@57 Vertical spacing between squares on the Landmark board.
(defconst landmark-square-height 1 (#$ . 2430))
#@74 Number of columns between the Landmark board and the side of the window.
(defconst landmark-x-offset 3 (#$ . 2540))
#@71 Number of lines between the Landmark board and the top of the window.
(defconst landmark-y-offset 1 (#$ . 2662))
#@60 If non-nil, its value is called on entry to Landmark mode.
(custom-declare-variable 'landmark-mode-hook nil '(#$ . 2781) :type 'hook :group 'landmark)
#@39 Local keymap to use in Landmark mode.
(defvar landmark-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\341#\210\302\342\341#\210\302\343\344#\210\302\345\344#\210\302\346\344#\210\302\347\350#\210\302\351\350#\210\302\352\322#\210\302\353\320#\210\302\354\355#\210\302\356\357#\210\302\360\361#\210\302\362\361#\210)\207" [map make-sparse-keymap define-key "y" landmark-move-nw "u" landmark-move-ne "b" landmark-move-sw "n" landmark-move-se "h" backward-char "l" forward-char "j" landmark-move-down "k" landmark-move-up [kp-7] [kp-9] [kp-1] [kp-3] [kp-4] [kp-6] [kp-2] [kp-8] "" "" "X" landmark-human-plays "x" " " landmark-start-robot [down-mouse-1] [drag-mouse-1] landmark-click [mouse-1] [down-mouse-2] [mouse-2] landmark-mouse-play [drag-mouse-2] [remap previous-line] [remap next-line] [remap beginning-of-line] landmark-beginning-of-line [remap end-of-line] landmark-end-of-line [remap undo] landmark-human-takes-back [remap advertised-undo]] 4) (#$ . 2938))
#@58 For making font-lock use the winner's face for the line.
(defvar landmark-emacs-won nil (#$ . 4273))
(byte-code "\300\301\302\303\304\305\306\307&\210\300\310\311\312\304\305\306\307&\207" [custom-declare-face landmark-font-lock-face-O ((((class color)) :foreground "red") (t :weight bold)) "Face to use for Emacs's O." :version "22.1" :group landmark landmark-font-lock-face-X ((((class color)) :foreground "green") (t :weight bold)) "Face to use for your X."] 8)
#@31 Font lock rules for Landmark.
(defvar landmark-font-lock-keywords '(("O" quote landmark-font-lock-face-O) ("X" quote landmark-font-lock-face-X) ("[-|/\\]" 0 (if landmark-emacs-won 'landmark-font-lock-face-O 'landmark-font-lock-face-X))) (#$ . 4746))
(byte-code "\300\301\302\300\301\303\304##\210\300\301\305\306#\210\300\301\307\310#\207" [put landmark-mode front-sticky rear-nonsticky (intangible) intangible 1 mode-class special] 7)
#@515 Major mode for playing Landmark 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.

You play by moving the cursor over the square you choose and hitting \[landmark-human-plays].

Other useful commands:
\{landmark-mode-map}
Entry to this mode calls the value of `landmark-mode-hook' if that value
is non-nil.  One interesting value is `turn-on-font-lock'.
(defalias 'landmark-mode #[nil "\305 \210\306\307\310 \210\311\n!\210\312\303!\210\313\314\315\316!\207" [major-mode mode-name landmark-mode-map font-lock-defaults buffer-read-only kill-all-local-variables landmark-mode "Landmark" landmark-display-statistics use-local-map make-local-variable (landmark-font-lock-keywords t) t run-mode-hooks landmark-mode-hook] 2 (#$ . 5189) nil])
#@56 Vector recording the actual score of the free squares.
(defvar landmark-score-table nil (#$ . 6095))
#@27 Score of an empty qtuple.
(defconst landmark-nil-score 7 (#$ . 6202))
#@52 Vector associating qtuple contents to their score.
(defconst landmark-score-trans-table (byte-code "\306\307\310\311\312\313\314\315\316
\f\317\317\211\211\211\211\n\317\211\211\211\211	\317\211\211\211\211\317\211\211\211\211\211&.\207" [OOOOscore OOOscore OOscore Oscore XXXXscore XXXscore 15 400 1800 100000 35 800 15000 800000 vector 0 XXscore Xscore landmark-nil-score] 32) (#$ . 6278))
#@56 Threshold score beyond which an Emacs move is winning.
(defconst landmark-winning-threshold (aref landmark-score-trans-table 24) (#$ . 6696))
#@55 Threshold score beyond which a human move is winning.
(defconst landmark-losing-threshold (aref landmark-score-trans-table 4) (#$ . 6844))
#@66 Compute index of free square with highest score, or nil if none.
(defalias 'landmark-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" [landmark-board-width landmark-board-height score best-square end square 0 landmark-xy-to-index 1 nil zerop -1 random count score-max landmark-score-table landmark-board] 7 (#$ . 6989)])
#@49 Recorded initial value of previous score table.
(defvar landmark-saved-score-table nil (#$ . 7515))
#@41 Recorded value of previous board width.
(defvar landmark-saved-board-width nil (#$ . 7621))
#@42 Recorded value of previous board height.
(defvar landmark-saved-board-height nil (#$ . 7719))
#@64 Create the score table vector and fill it with initial values.
(defalias 'landmark-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" [landmark-saved-score-table landmark-board-width landmark-saved-board-width landmark-board-height landmark-saved-board-height landmark-score-table copy-sequence make-vector 20 nil 2 4 1 landmark-init-square-score landmark-vector-length landmark-nil-score maxj2 maxi2 maxj maxi j i] 7 (#$ . 7819)])
#@53 Return the number of qtuples containing square I,J.
(defalias 'landmark-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 landmark-board-width j landmark-board-height down up 4 + -12 3 8 right left] 8 (#$ . 8554)])
#@60 Give initial score to square I,J and to its mirror images.
(defalias 'landmark-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" [landmark-board-width i landmark-board-height j landmark-score-trans-table sc landmark-nb-qtuples 0 landmark-xy-to-index jj ii landmark-score-table] 5 (#$ . 8879)])
#@60 Update score table after SQUARE received a DVAL increment.
(defalias 'landmark-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 landmark-board-width landmark-index-to-x landmark-index-to-y -4 1 0 - 4 landmark-update-score-in-direction 5 -1 imax landmark-board-height jmax dval] 7 (#$ . 9260)])
#@203 Update scores for all squares in the qtuples in range.
That is, those between the LEFTth square and the RIGHTth after SQUARE,
along the DX, DY direction, considering that DVAL has been added on SQUARE.
(defalias 'landmark-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 landmark-xy-to-index 4 0 zerop + square0 depl dx dy square landmark-board landmark-score-trans-table dval landmark-score-table] 7 (#$ . 9792)])
#@35 Non-nil if a game is in progress.
(defvar landmark-game-in-progress nil (#$ . 10579))
#@66 A record of all moves that have been played during current game.
(defvar landmark-game-history nil (#$ . 10671))
#@49 Number of moves already played in current game.
(defvar landmark-number-of-moves nil (#$ . 10790))
#@58 Number of moves already played by human in current game.
(defvar landmark-number-of-human-moves nil (#$ . 10895))
#@32 Non-nil if Emacs played first.
(defvar landmark-emacs-played-first nil (#$ . 11015))
#@52 Non-nil if Human took back a move during the game.
(defvar landmark-human-took-back nil (#$ . 11106))
#@49 Non-nil if Human refused Emacs offer of a draw.
(defvar landmark-human-refused-draw nil (#$ . 11214))
#@53 Non-nil if Emacs is in the middle of a computation.
(defvar landmark-emacs-is-computing nil (#$ . 11322))
#@43 Initialize a new game on an N by M board.
(defalias 'landmark-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" [landmark-emacs-is-computing landmark-game-in-progress n landmark-board-width m landmark-board-height t 2 * 7 10 nil 0 landmark-init-display landmark-init-score-table landmark-init-board landmark-vector-length landmark-draw-limit landmark-emacs-won landmark-game-history landmark-number-of-moves landmark-number-of-human-moves landmark-emacs-played-first landmark-human-took-back landmark-human-refused-draw] 5 (#$ . 11434)])
#@47 Go to SQUARE, play VAL and update everything.
(defalias 'landmark-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" [landmark-emacs-is-computing val landmark-number-of-human-moves landmark-number-of-moves landmark-emacs-played-first square t 1 zerop landmark-plot-square landmark-update-score-table -1 nil landmark-score-table landmark-game-history landmark-board dont-update-score] 3 (#$ . 12091)])
#@44 Take back last move and update everything.
(defalias 'landmark-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" [landmark-emacs-is-computing landmark-game-history last-move square landmark-board oldval t 1 landmark-plot-square 0 landmark-update-score-table nil landmark-number-of-human-moves landmark-number-of-moves landmark-score-table] 4 (#$ . 12627)])
#@49 The number of times that landmark has been run.
(defvar landmark-number-of-trials 0 (#$ . 13073))
#@46 The total number of moves made in all games.
(defvar landmark-sum-of-moves 0 (#$ . 13177))
#@44 Number of games Emacs won in this session.
(defvar landmark-number-of-emacs-wins 0 (#$ . 13274))
#@42 Number of games you won in this session.
(defvar landmark-number-of-human-wins 0 (#$ . 13377))
#@48 Number of games already drawn in this session.
(defvar landmark-number-of-draws 0 (#$ . 13478))
#@41 Terminate the current game with RESULT.
(defalias 'landmark-terminate-game #[(result) "T	\n\\\305=\203\306\307!\210\310 \210\311\211\207" [landmark-number-of-trials landmark-sum-of-moves landmark-number-of-moves result landmark-game-in-progress crash-game message "Sorry, I have been interrupted and cannot resume that game..." landmark-display-statistics nil] 2 (#$ . 13580)])
#@56 What to do when Emacs detects it has been interrupted.
(defalias 'landmark-crash-game #[nil "\301\302\303!\210\304\305!\210\306 \207" [landmark-emacs-is-computing nil landmark-terminate-game crash-game sit-for 4 landmark-prompt-for-other-game] 2 (#$ . 13971)])
#@38 Compute Emacs next move and play it.
(defalias 'landmark-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" [landmark-emacs-is-computing landmark-game-in-progress score square landmark-score-table landmark-winning-threshold landmark-switch-to-window landmark-crash-game landmark-prompt-for-other-game message "Let me think..." nil landmark-strongest-square landmark-terminate-game nobody-won landmark-play-move 6 t landmark-find-filled-qtuple emacs-won zerop landmark-offer-a-draw draw-agreed landmark-prompt-for-move landmark-emacs-won landmark-number-of-moves landmark-draw-limit landmark-human-refused-draw] 4 (#$ . 14239) nil])
#@41 Position at the square where you click.
(defalias 'landmark-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 landmark-x-offset landmark-square-width landmark-board-width landmark-y-offset windowp event-end 5 select-window posn-col-row landmark-goto-xy + - 1 window-hscroll 2 t count-lines window-start inhibit-point-motion-hooks landmark-square-height landmark-board-height] 10 (#$ . 15092) "e"])
#@37 Play at the square where you click.
(defalias 'landmark-mouse-play #[(click) "\301!\205\302 \207" [click landmark-click landmark-human-plays] 2 (#$ . 15739) "e"])
#@186 Signal to the Landmark 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 'landmark-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" [landmark-emacs-is-computing landmark-game-in-progress score square landmark-board landmark-score-table landmark-switch-to-window landmark-crash-game landmark-prompt-for-other-game nil landmark-point-square error "Your point is not on a square. Retry!" zerop "Your point is not on a free square. Retry!" landmark-play-move 1 landmark-find-filled-qtuple landmark-terminate-game human-won landmark-emacs-plays landmark-losing-threshold] 4 (#$ . 15912) nil])
#@75 Signal to the Landmark program that you wish to take back your last move.
(defalias 'landmark-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" [landmark-emacs-is-computing landmark-game-in-progress landmark-number-of-human-moves landmark-human-took-back number landmark-switch-to-window landmark-crash-game message "Too late for taking back..." sit-for 4 landmark-prompt-for-other-game zerop "You have not played yet... Your move?" "One moment, please..." t landmark-take-back landmark-prompt-for-move] 2 (#$ . 16786) nil])
#@61 Signal to the Landmark program that you may want to resign.
(defalias 'landmark-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" [landmark-emacs-is-computing landmark-game-in-progress landmark-switch-to-window landmark-crash-game message "There is no game in progress" y-or-n-p "You mean, you resign? " landmark-terminate-game human-resigned "You mean, we continue? " landmark-prompt-for-move] 2 (#$ . 17444) nil])
#@44 Display a message asking for Human's move.
(defalias 'landmark-prompt-for-move #[nil "\301\302!\203\303\202\f\304!\207" [landmark-number-of-human-moves message zerop "Your move? (move to a free square and hit X, RET ...)" "Your move?"] 3 (#$ . 17950)])
#@37 Ask for another game, and start it.
(defalias 'landmark-prompt-for-other-game #[nil "\300\301!\203\300\302!\203\303\304!\207\303\305!\207\306\307!\207" [y-or-n-p "Another game? " "Retain learned weights " landmark 2 1 message "Chicken!"] 2 (#$ . 18213)])
#@49 Offer a draw and return t if Human accepted it.
(defalias 'landmark-offer-a-draw #[nil "\301\302!\206\n\303\211?\207" [landmark-human-refused-draw y-or-n-p "I offer you a draw. Do you accept it? " t] 2 (#$ . 18478)])
#@54 Largest possible board width for the current window.
(defalias 'landmark-max-width #[nil "\302\303\304 !\211\305$	\245T\207" [landmark-x-offset landmark-square-width - window-width selected-window 1] 5 (#$ . 18703)])
#@55 Largest possible board height for the current window.
(defalias 'landmark-max-height #[nil "\302\303\304 !\211\305$	\245T\207" [landmark-y-offset landmark-square-height - window-height selected-window 2] 5 (#$ . 18927)])
#@38 Return the board row where point is.
(defalias 'landmark-point-y #[nil "\303\304\305\306`\"	n\203\307\202\306#\n\245T)\207" [inhibit-point-motion-hooks landmark-y-offset landmark-square-height t - count-lines 1 0] 4 (#$ . 19155)])
#@45 Return the index of the square point is on.
(defalias 'landmark-point-square #[nil "\303\304i	Z\n\245T\305 \")\207" [inhibit-point-motion-hooks landmark-x-offset landmark-square-width t landmark-xy-to-index landmark-point-y] 3 (#$ . 19397)])
#@36 Move point to square number INDEX.
(defalias 'landmark-goto-square #[(index) "\301\302!\303!\"\207" [index landmark-goto-xy landmark-index-to-x landmark-index-to-y] 4 (#$ . 19646)])
#@38 Move point to square at X, Y coords.
(defalias 'landmark-goto-xy #[(x y) "\306eb\210	\nS_\\y\210)\307\f
S_\\!\207" [inhibit-point-motion-hooks landmark-y-offset landmark-square-height y landmark-x-offset landmark-square-width t move-to-column x] 4 (#$ . 19836)])
#@71 Draw 'X', 'O' or '.' on SQUARE depending on VALUE, leave point there.
(defalias 'landmark-plot-square #[(square value) "\304U\204\n\305	!\210\306\211\307\304U\203\310\202H\311U\203#\312\202H\313U\203-\314\202H\315U\2037\316\202H\317U\203A\320\202H\321U\205H\322!\210\323!\203W\324`S`\325#\210\326\304!\210\327u\210*\330\331!\207" [value square inhibit-point-motion-hooks inhibit-read-only 1 landmark-goto-square t insert-and-inherit 46 2 78 3 83 4 69 5 87 6 94 zerop add-text-properties (mouse-face highlight help-echo "mouse-1: get robot moving, mouse-2: play on this square") delete-char -1 sit-for 0] 4 (#$ . 20109)])
#@35 Display an N by M Landmark board.
(defalias 'landmark-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\332=\204\321\323\310\314\333\334$\210\f\204\335\323\"`\304\314$\210\323\"`\333\335$\210\323e`\336\337$\210.\340(T\314\245T\314\245\"\210\341\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 61 add-text-properties (mouse-face highlight help-echo "mouse-1: get robot moving, mouse-2: play on this square") 10 46 point-entered #[(_x _y) "o\205\300u\207" [nil] 1] #[(_x _y) "m\205\300u\207" [-1] 1] category landmark-mode landmark-goto-xy sit-for point inhibit-read-only landmark-x-offset landmark-square-width tab-width landmark-y-offset n landmark-square-height] 8 (#$ . 20760)])
#@72 Obnoxiously display some statistics about previous games in mode line.
(defalias 'landmark-display-statistics #[nil "\303\304\305!\203
\306\202	\245#\307 \207" [landmark-number-of-trials landmark-sum-of-moves mode-line-process format ": Trials: %d, Avg#Moves: %d" zerop 0 force-mode-line-update] 5 (#$ . 21963)])
#@53 Find or create the Landmark buffer, and display it.
(defalias 'landmark-switch-to-window #[nil "\302\303!\211\203\304!\202	\203\305 \210\304\303!\210\306 )\207" [buff landmark-game-in-progress get-buffer "*Landmark*" switch-to-buffer landmark-crash-game landmark-mode] 3 (#$ . 22289) nil])
#@60 Return t if SQUARE belongs to a qtuple filled with VALUEs.
(defalias 'landmark-find-filled-qtuple #[(square value) "\302	\303\304$\206!\302	\304\303$\206!\302	\303\211$\206!\302	\305\303$\207" [square value landmark-check-filled-qtuple 1 0 -1] 5 (#$ . 22593)])
#@73 Return t if SQUARE belongs to a qtuple filled with VALUEs along DX, DY.
(defalias 'landmark-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 landmark-xy-to-index -4 4 landmark-cross-qtuple t b a value landmark-board] 8 (#$ . 22867)])
#@73 Cross every square between SQUARE1 and SQUARE2 in the DX, DY direction.
(defalias 'landmark-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 landmark-xy-to-index t landmark-goto-square 0 1 insert-char 45 " 	" nil insert-and-inherit 124 -1 2 47 92 sit-for square2 landmark-square-width column landmark-n landmark-square-height] 4 (#$ . 23327)])
#@48 Move point down one row on the Landmark board.
(defalias 'landmark-move-down #[nil "\301 W\205	\302y\207" [landmark-board-height landmark-point-y 1] 2 (#$ . 24067) nil])
#@46 Move point up one row on the Landmark board.
(defalias 'landmark-move-up #[nil "\301 \302V\205\n[y\207" [landmark-square-height landmark-point-y 1] 2 (#$ . 24245) nil])
#@46 Move point North East on the Landmark board.
(defalias 'landmark-move-ne #[nil "\300 \210\301u\207" [landmark-move-up nil] 1 (#$ . 24422) nil])
#@46 Move point South East on the Landmark board.
(defalias 'landmark-move-se #[nil "\300 \210\301u\207" [landmark-move-down nil] 1 (#$ . 24572) nil])
#@46 Move point North West on the Landmark board.
(defalias 'landmark-move-nw #[nil "\300 \210\301u\207" [landmark-move-up -1] 1 (#$ . 24724) nil])
#@46 Move point South West on the Landmark board.
(defalias 'landmark-move-sw #[nil "\300 \210\301u\207" [landmark-move-down -1] 1 (#$ . 24873) nil])
#@55 Move point to first square on the Landmark board row.
(defalias 'landmark-beginning-of-line #[nil "\301!\207" [landmark-x-offset move-to-column] 2 (#$ . 25024) nil])
#@54 Move point to last square on the Landmark board row.
(defalias 'landmark-end-of-line #[nil "\303	\nS_\\!\207" [landmark-x-offset landmark-square-width landmark-board-width move-to-column] 4 (#$ . 25197) nil])
#@146 Not used.
Affects a noise generator which was used in an earlier incarnation of
this program to add a random element to the way moves were made.
(defvar landmark-nvar 0.0075 (#$ . 25414))
#@65 Used when doing something relative to the north and south axes.
(defvar landmark-ns '(landmark-n landmark-s) (#$ . 25608))
#@63 Used when doing something relative to the east and west axes.
(defvar landmark-ew '(landmark-e landmark-w) (#$ . 25737))
#@26 The cardinal directions.
(defvar landmark-directions '(landmark-n landmark-s landmark-e landmark-w) (#$ . 25864))
#@33 The full 8 possible directions.
(defvar landmark-8-directions '((landmark-n) (landmark-n landmark-w) (landmark-w) (landmark-s landmark-w) (landmark-s) (landmark-s landmark-e) (landmark-e) (landmark-n landmark-e)) (#$ . 25984))
(defvar landmark-number-of-moves "The number of moves made by the robot so far.")
#@35 If non-nil, debugging is printed.
(defvar landmark-debug nil (#$ . 26299))
(byte-code "\300\301\302\303\304\305\306\307&\210\300\310\311\312\304\305\306\307&\207" [custom-declare-variable landmark-one-moment-please nil "If non-nil, print \"One moment please\" when a new board is generated.\nThe drawback of this is you don't see how many moves the last run took\nbecause it is overwritten by \"One moment please\"." :type boolean :group landmark landmark-output-moves t "If non-nil, output number of moves so far on a move-by-move basis."] 8)
(defalias 'landmark-weights-debug #[nil "\205\301 \210\302 \210\303 \210\304 \207" [landmark-debug landmark-print-wts landmark-blackbox landmark-print-y-s-noise landmark-print-smell] 1])
(defalias 'landmark-print-distance-int #[(direction) "\301\302\211\303N#c\207" [direction format "%S %S " distance] 5 nil nil])
(defalias 'landmark-print-distance #[nil "\301\302\303\304!\"c\210\305\306\"\207" [landmark-directions format "tree: %S \n" calc-distance-of-robot-from landmark-tree mapc landmark-print-distance-int] 4])
(defalias 'landmark-nslify-wts-int #[(direction) "\301\302\"\207" [landmark-directions mapcar #[(target-direction) "	N\207" [direction target-direction] 2]] 3])
(defalias 'landmark-nslify-wts #[nil "\302\303\304\305\"\"\306\307	\"c\210\306\310\311\312	B!\311\313	B!#c)\207" [landmark-directions l apply append mapcar landmark-nslify-wts-int format "set data_value WTS \n %s \n" "/* max: %S min: %S */" eval max min] 6 nil nil])
(defalias 'landmark-print-wts-int #[(direction) "\301\302\"\210\303c\207" [landmark-directions mapc #[(target-direction) "\302\303		N$c\207" [direction target-direction format "%S %S %S "] 6] "\n"] 3])
(defalias 'landmark-print-wts #[nil "r\301q\210\302c\210\303\304\")\207" [landmark-directions "*landmark-wts*" "==============================\n" mapc landmark-print-wts-int] 3 nil nil])
(defalias 'landmark-print-moves #[(moves) "r\301q\210\302\303\"c)\207" [moves "*landmark-moves*" format "%S\n"] 3 nil nil])
(defalias 'landmark-print-y-s-noise-int #[(direction) "\301\302\303!\304N\305N\306N%c\207" [direction format "%S:landmark-y %S, s %S, noise %S \n" symbol-name y_t s noise] 7])
(defalias 'landmark-print-y-s-noise #[nil "r\301q\210\302c\210\303\304\")\207" [landmark-directions "*landmark-y,s,noise*" "==============================\n" mapc landmark-print-y-s-noise-int] 3 nil nil])
(defalias 'landmark-print-smell-int #[(direction) "\301\302\303!\304N#c\207" [direction format "%S: smell: %S \n" symbol-name smell] 5])
(defalias 'landmark-print-smell #[nil "r\301q\210\302c\210\303\304\305\306N\"c\210\307\310\")\207" [landmark-directions "*landmark-smell*" "==============================\n" format "tree: %S \n" z t mapc landmark-print-smell-int] 4 nil nil])
(defalias 'landmark-print-w0-int #[(direction) "\301\302\303!\304N#c\207" [direction format "%S: w0: %S \n" symbol-name w0] 5])
(defalias 'landmark-print-w0 #[nil "r\301q\210\302c\210\303\304\")\207" [landmark-directions "*landmark-w0*" "==============================\n" mapc landmark-print-w0-int] 3 nil nil])
(defalias 'landmark-blackbox #[nil "r\301q\210\302c\210\303c\210\304\305\"\210\306c\210\307c\210\304\310\"\210\306c\210\311 \210\312\313\314\315N\314\316NZ\"c\210\317 \210\306c)\207" [landmark-directions "*landmark-blackbox*" "==============================\n" "I smell: " mapc #[(direction) "\301N\302V\205
\303\304\"c\207" [direction smell 0 format "%S "] 3] "\n" "I move: " #[(direction) "\301N\302V\205
\303\304\"c\207" [direction y_t 0 format "%S "] 3] landmark-print-wts-blackbox format "z_t-z_t-1: %S" z t t-1 landmark-print-distance] 5])
(defalias 'landmark-print-wts-blackbox #[nil "\301\302\"\207" [landmark-directions mapc landmark-print-wts-int] 3 nil nil])
(byte-code "\300\301\302\303\304\305\306\307&\210\300\310\311\312\304\305\306\307&\210\300\313\314\315\304\305\306\307&\207" [custom-declare-variable landmark-bound 0.005 "The maximum that w0j may be." :type number :group landmark landmark-c 1.0 "A factor applied to modulate the increase in wij.\nUsed in the function landmark-update-normal-weights." landmark-c-naught 0.5 "A factor applied to modulate the increase in w0j.\nUsed in the function landmark-update-naught-weights."] 8)
(defvar landmark-initial-w0 0.0)
(defvar landmark-initial-wij 0.0)
(byte-code "\300\301\302\303\304\305\306\307&\210\300\310\311\312\304\305\306\307&\207" [custom-declare-variable landmark-no-payoff 0 "The amount of simulation cycles that have occurred with no movement.\nUsed to move the robot when he is stuck in a rut for some reason." :type integer :group landmark landmark-max-stall-time 2 "The maximum number of cycles that the robot can remain stuck in a place.\nAfter this limit is reached, landmark-random-move is called to push him out of it."] 8)
(defalias 'landmark-flip-a-coin #[nil "\300\301!\302V\203\n\303\207\304\207" [random 5000 2500 -1 1] 2])
(defalias 'landmark-randomize-weights-for #[(direction) "\301\302\"\207" [landmark-directions mapc #[(target-direction) "\302	\303 \304\305!\306\245_#\207" [direction target-direction put landmark-flip-a-coin random 10000 10000.0] 6]] 3])
(defalias 'landmark-noise #[nil "\301\302!\303\245S_\207" [landmark-nvar random 30001 15000.0] 2])
(defalias 'landmark-fix-weights-for #[(direction) "\301\302\"\207" [landmark-directions mapc #[(target-direction) "\303	\n#\207" [direction target-direction landmark-initial-wij put] 4]] 3])
(defalias 'landmark-plot-internal #[(sym) "\301\302\303N\304N\"\300N\"\207" [sym landmark-plot-square landmark-xy-to-index x y] 5])
(defalias 'landmark-plot-landmarks #[nil "\304\245\n\304\245\305\306\307	#\210\305\306\310\311#\210\305\306\312\304#\210\305\313\307	#\210\305\313\310#\210\305\313\312\314#\210\305\315\307	#\210\305\315\310\n#\210\305\315\312\316#\210\305\317\307\311#\210\305\317\310\n\304\245#\210\305\317\312\320#\210\305\321\307#\210\305\321\310\n\304\245#\210\305\321\312\322#\210\323\324\325\"\207" [landmark-board-width landmark-cx landmark-board-height landmark-cy 2 put landmark-n x y 1 sym landmark-tree 6 landmark-s 3 landmark-w 5 landmark-e 4 mapc landmark-plot-internal (landmark-n landmark-s landmark-e landmark-w landmark-tree)] 5])
(defalias 'square #[(a) "\211_\207" [a] 2])
(defalias 'distance #[(x x0 y y0) "\304\305	Z!\305\nZ!\\!\207" [x x0 y y0 sqrt square] 5])
(defalias 'calc-distance-of-robot-from #[(direction) "\301\302\211\303N\304\305 !\306N\307\305 !$#\207" [direction put distance x landmark-index-to-x landmark-point-square y landmark-index-to-y] 9])
(defalias 'calc-smell-internal #[(sym) "\302N\303!\304\305	\n\245Z_\306V\203\307\305	\n\245Z_\202\306*\207" [sym d r calc-distance-of-robot-from 0.5 1 0 0.5] 4])
(defalias 'landmark-f #[(x) "	V\203	\207\302W\203\303\207\207" [x landmark-bound 0.0 0.0] 2])
(defalias 'landmark-y #[(direction) "\301\302\303 #\210\301\304\305N\306V\203\307\202\310#\207" [direction put noise landmark-noise y_t s 0.0 1.0 0.0] 5])
(defalias 'landmark-update-normal-weights #[(direction) "\301\302\"\207" [landmark-directions mapc #[(target-direction) "\303		N\304\n\305\306N\305\307NZ	\310N\311N$\\#\207" [direction target-direction landmark-c put * z t t-1 y_t smell] 10]] 3])
(defalias 'landmark-update-naught-weights #[(direction) "\301\302\"\207" [landmark-directions mapc #[(_target-direction) "\302\303\304\303N\305	\306\307N\306\310NZ\311N#\\!#\207" [direction landmark-c-naught put w0 landmark-f * z t t-1 y_t] 10]] 3])
(defalias 'landmark-calc-current-smells #[nil "\301\302\"\207" [landmark-directions mapc #[(direction) "\301\302\303!#\207" [direction put smell calc-smell-internal] 5]] 3])
(defalias 'landmark-calc-payoff #[nil "\301\302\303\302\304N#\210\301\302\304\305\306!#\210\302\304N\302\303NZ\307U\203!T\211\207\310\211\207" [landmark-no-payoff put z t-1 t calc-smell-internal landmark-tree 0.0 0] 5])
(defalias 'landmark-store-old-y_t #[nil "\301\302\"\207" [landmark-directions mapc #[(direction) "\301\302\303N#\207" [direction put y_t-1 y_t] 5]] 3])
(defalias 'landmark-confidence-for #[(target-direction) "\302\303\304N\305\306	\"#\207" [target-direction landmark-directions apply + w0 mapcar #[(direction) "	N\302N_\207" [direction target-direction smell] 3]] 6])
(defalias 'landmark-calc-confidences #[nil "\301\302\"\207" [landmark-directions mapc #[(direction) "\301\302\303!#\207" [direction put s landmark-confidence-for] 5]] 3])
(defalias 'landmark-move #[nil "\305\306N\307U\203\310\306N\311U\203\312\313\"\210	\203\314\315!\210\316\306N\317U\203:\320\306N\321U\203:\312\322\n\"\210	\203:\314\323!\210\312\324\325\"\210\326\327 \330\"\210T\f\205P\314\331\"\207" [landmark-ns landmark-debug landmark-ew landmark-number-of-moves landmark-output-moves landmark-n y_t 1.0 landmark-s 1.0 mapc #[(dir) "\301\302\303#\207" [dir put y_t 0] 4] message "n-s normalization." landmark-w 1.0 landmark-e 1.0 #[(dir) "\301\302\303#\207" [dir put y_t 0] 4] "e-w normalization" #[(pair) "@\301N\302V\205
A@ \207" [pair y_t 0] 2] ((landmark-n landmark-move-up) (landmark-s landmark-move-down) (landmark-e forward-char) (landmark-w backward-char)) landmark-plot-square landmark-point-square 1 "Moves made: %d"] 3])
(defalias 'landmark-random-move #[nil "\304\305\"\210\306\307!	8\310\211\203!@\311\n\312\313#\210A\211\204*\314 \207" [landmark-directions landmark-8-directions direction --dolist-tail-- mapc #[(direction) "\301\302\303#\207" [direction put y_t 0] 4] random 8 nil put y_t 1.0 landmark-move] 5])
(defalias 'landmark-amble-robot #[nil "\304\305!\306V\203<\307 \210\310 \210	V\203\311 \210\202%\312 \210\313\314\n\"\210\315 \210\316 \210\313\317\n\"\210\313\320\n\"\210\203\321 \210\202\322\323!\207" [landmark-no-payoff landmark-max-stall-time landmark-directions landmark-debug calc-distance-of-robot-from landmark-tree 0 landmark-store-old-y_t landmark-calc-current-smells landmark-random-move landmark-calc-confidences mapc landmark-y landmark-move landmark-calc-payoff landmark-update-normal-weights landmark-update-naught-weights landmark-weights-debug landmark-terminate-game nil] 3 nil nil])
#@186 Signal to the Landmark 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 'landmark-start-robot #[nil "\305 \210\203\n\306 \207	\204\307 \207\310\311 \211\204 \312\313!\202S\314\nH!\204.\312\315!\202S\316\n\317\"\210\320 \210\321 \210\322\323\324\325\326!#\210\327 \210\330 \210\331\332\f\"\210\331\333\f\"\210\334 )\207" [landmark-emacs-is-computing landmark-game-in-progress square landmark-board landmark-directions landmark-switch-to-window landmark-crash-game landmark-prompt-for-other-game nil landmark-point-square error "Your point is not on a square. Retry!" zerop "Your point is not on a free square. Retry!" landmark-plot-square 1 landmark-store-old-y_t landmark-calc-current-smells put z t calc-smell-internal landmark-tree landmark-random-move landmark-calc-payoff mapc landmark-update-normal-weights landmark-update-naught-weights landmark-amble-robot] 6 (#$ . 36478) nil])
(defvar landmark-tree-r "")
(defalias 'landmark-init #[(auto-start save-weights) "\306\307 \210	\203@r\310\311!q\210\312 \210\310\313!q\210\310\314!q\210\312 \210\310\315!q\210\312 \210\310\316!q\210\312 \210\310\317!q\210\312 \210\310\320!q\210\312 \210)\321 \210\n\322\211\203[\f@\323\324\325#\210\fA\211\204K*
\204\202\326\327\n\"\210\n\322\211\203~\f@\323\330#\210\fA\211\204m*\202\206\331\332!\210\205\232\333\334 !T\334!!T\"\210\335 \207" [landmark-number-of-moves landmark-debug landmark-directions direction --dolist-tail-- save-weights 0 landmark-plot-landmarks get-buffer-create "*landmark-w0*" erase-buffer "*landmark-moves*" "*landmark-wts*" "*landmark-y,s,noise*" "*landmark-smell*" "*landmark-blackbox*" "*landmark-distance*" landmark-set-landmark-signal-strengths nil put y_t 0.0 mapc landmark-fix-weights-for w0 message "Weights preserved for this run." landmark-goto-xy random landmark-start-robot landmark-initial-w0 auto-start landmark-board-width landmark-board-height] 5])
(defalias 'landmark-set-landmark-signal-strengths #[nil "\305\306!\306	!\\!\307_\310\311\"\210\310\312\f\"\210\313\314\315\n#\207" [landmark-cx landmark-cy landmark-tree-r landmark-ew landmark-ns sqrt square 1.5 mapc #[(direction) "\302\303	\304_#\207" [direction landmark-cx put r 1.1] 5] #[(direction) "\302\303	\304_#\207" [direction landmark-cy put r 1.1] 5] put landmark-tree r] 4])
(defalias 'landmark-repeat 'landmark-test-run)
#@78 Run 100 Landmark games, each time saving the weights from the previous game.
(defalias 'landmark-test-run #[nil "\302\303!\210\304\305	W\205\302\306!\210T\211\202	*\207" [scratch-var --dotimes-limit-- landmark 1 100 0 2] 3 (#$ . 38963) nil])
#@626 Start or resume an Landmark game.
If a game is in progress, this command allows you to resume it.
Here is the relation between prefix args and game options:

prefix arg | robot is auto-started | weights are saved from last game
---------------------------------------------------------------------
none / 1   | yes                   | no
       2   | yes                   | yes
       3   | no                    | yes
       4   | no                    | no

You start by moving to a square and typing \[landmark-start-robot],
if you did not use a prefix arg to ask for automatic start.
Use \[describe-mode] for more info.
(defalias 'landmark #[(parg) "\306\211\307 \210\n\203\310 \207\203\f\311X\205\252\312 \313  \204& 	\204,
\314W\2039\315\316!\210\202R	\314W\203F\315\317!\210\202R V\203R\315\320\"\210	
V\203j	!=\204j\321\322\323	\"!\204j
*\"\203t\324\325!\210\326	\"\210\327\330#\314U\203\206\331\202\250#\311U\203\221\332\202\250#\333U\203\234\334\202\250#\335U\203\247\336\202\250\337B!\207" [landmark-n landmark-m landmark-emacs-is-computing landmark-game-in-progress landmark-number-of-moves max-height nil landmark-switch-to-window landmark-crash-game 2 landmark-max-width landmark-max-height 1 error "I need at least 1 column" "I need at least 1 row" "I cannot display %d columns in that window" y-or-n-p format "Do you really want %d rows? " message "One moment, please..." landmark-start-game eval landmark-init (t nil) (t t) 3 (nil t) 4 (nil nil) (nil t) max-width landmark-saved-board-height landmark-one-moment-please parg] 5 (#$ . 39220) "p"])
(provide 'landmark)

MMCT - 2023