X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/233ba4d924933cb56129bd7511e6137b7c0b8e3e..41b7f8bc6c4511ab6fcf7f6b1f9e7fdcd8592821:/lisp/play/landmark.el diff --git a/lisp/play/landmark.el b/lisp/play/landmark.el index dd32fd790d..9ffc308928 100644 --- a/lisp/play/landmark.el +++ b/lisp/play/landmark.el @@ -1,6 +1,6 @@ ;;; landmark.el --- neural-network robot that learns landmarks -;; Copyright (C) 1996-1997, 2000-2011 Free Software Foundation, Inc. +;; Copyright (C) 1996-1997, 2000-2012 Free Software Foundation, Inc. ;; Author: Terrence Brannon (was: ) ;; Created: December 16, 1996 - first release to usenet @@ -139,16 +139,16 @@ ;; look rectangular, but spacings SHOULD be at least 2 (MUST BE at least 1). (defconst landmark-square-width 2 - "*Horizontal spacing between squares on the Landmark board.") + "Horizontal spacing between squares on the Landmark board.") (defconst landmark-square-height 1 - "*Vertical spacing between squares on the Landmark board.") + "Vertical spacing between squares on the Landmark board.") (defconst landmark-x-offset 3 - "*Number of columns between the Landmark board and the side of the window.") + "Number of columns between the Landmark board and the side of the window.") (defconst landmark-y-offset 1 - "*Number of lines between the Landmark board and the top of the window.") + "Number of lines between the Landmark board and the top of the window.") ;;;_ + LANDMARK MODE AND KEYMAP. @@ -206,11 +206,11 @@ (defvar landmark-emacs-won () - "*For making font-lock use the winner's face for the line.") + "For making font-lock use the winner's face for the line.") (defface landmark-font-lock-face-O '((((class color)) :foreground "red") (t :weight bold)) - "Face to use for Emacs' O." + "Face to use for Emacs's O." :version "22.1" :group 'landmark) @@ -226,7 +226,7 @@ ("[-|/\\]" 0 (if landmark-emacs-won 'landmark-font-lock-face-O 'landmark-font-lock-face-X))) - "*Font lock rules for Landmark.") + "Font lock rules for Landmark.") (put 'landmark-mode 'front-sticky (put 'landmark-mode 'rear-nonsticky '(intangible))) @@ -385,7 +385,7 @@ is non-nil. One interesting value is `turn-on-font-lock'." best-square square score-max score) (aset landmark-score-table square -1))) ; no: kill it ! - ;; If score is equally good, choose randomly. But first check freeness: + ;; If score is equally good, choose randomly. But first check freedom: ((not (zerop (aref landmark-board square))) (aset landmark-score-table square -1)) ((zerop (random (setq count (1+ count)))) @@ -943,11 +943,11 @@ mouse-1: get robot moving, mouse-2: play on this square"))) (insert-char ?\n landmark-square-height)) (or (eq (char-after 1) ?.) (put-text-property 1 2 'point-entered - (lambda (x y) (if (bobp) (forward-char))))) + (lambda (_x _y) (if (bobp) (forward-char))))) (or intangible (put-text-property point (point) 'intangible 2)) (put-text-property point (point) 'point-entered - (lambda (x y) (if (eobp) (backward-char)))) + (lambda (_x _y) (if (eobp) (backward-char)))) (put-text-property (point-min) (point) 'category 'landmark-mode)) (landmark-goto-xy (/ (1+ n) 2) (/ (1+ m) 2)) ; center of the board (sit-for 0)) ; Display NOW @@ -1377,11 +1377,11 @@ After this limit is reached, landmark-random-move is called to push him out of i (t x))) (defun landmark-y (direction) - (let ((noise (put direction 'noise (landmark-noise)))) - (put direction 'y_t - (if (> (get direction 's) 0.0) - 1.0 - 0.0)))) + (put direction 'noise (landmark-noise)) + (put direction 'y_t + (if (> (get direction 's) 0.0) + 1.0 + 0.0))) (defun landmark-update-normal-weights (direction) (mapc (lambda (target-direction) @@ -1395,7 +1395,7 @@ After this limit is reached, landmark-random-move is called to push him out of i landmark-directions)) (defun landmark-update-naught-weights (direction) - (mapc (lambda (target-direction) + (mapc (lambda (_target-direction) (put direction 'w0 (landmark-f (+ @@ -1513,7 +1513,7 @@ If the game is finished, this command requests for another game." ((not landmark-game-in-progress) (landmark-prompt-for-other-game)) (t - (let (square score) + (let (square) (setq square (landmark-point-square)) (cond ((null square) (error "Your point is not on a square. Retry!")) @@ -1584,7 +1584,7 @@ If the game is finished, this command requests for another game." ;;;_ - something which doesn't work ; no-a-worka!! -;(defum landmark-sum-list (list) +;(defun landmark-sum-list (list) ; (if (> (length list) 0) ; (+ (car list) (landmark-sum-list (cdr list))) ; 0))