Customized.
This commit is contained in:
parent
a797a30d6b
commit
323f7c491f
11 changed files with 219 additions and 78 deletions
|
@ -106,11 +106,20 @@
|
|||
(require 'cookie1)
|
||||
|
||||
; Variables
|
||||
(defvar bruce-phrases-file "~/bruce.lines"
|
||||
"Keep your favorite phrases here.")
|
||||
(defgroup bruce nil
|
||||
"Insert phrases selected at random from a file into a buffer."
|
||||
:prefix "bruce-"
|
||||
:group 'games)
|
||||
|
||||
(defvar bruce-phrase-default-count 15
|
||||
"Default number of phrases to insert")
|
||||
(defcustom bruce-phrases-file "~/bruce.lines"
|
||||
"Keep your favorite phrases here."
|
||||
:type 'file
|
||||
:group 'bruce)
|
||||
|
||||
(defcustom bruce-phrase-default-count 15
|
||||
"Default number of phrases to insert."
|
||||
:type 'integer
|
||||
:group 'bruce)
|
||||
|
||||
;;;###autoload
|
||||
(defun bruce ()
|
||||
|
|
|
@ -93,22 +93,39 @@
|
|||
(eval-when-compile
|
||||
(require 'cl))
|
||||
|
||||
(defvar decipher-force-uppercase t
|
||||
(defgroup decipher nil
|
||||
"Cryptanalyze monoalphabetic substitution ciphers."
|
||||
:prefix "decipher-"
|
||||
:group 'games)
|
||||
|
||||
(defcustom decipher-force-uppercase t
|
||||
"*Non-nil means to convert ciphertext to uppercase.
|
||||
Nil means the case of the ciphertext is preserved.
|
||||
This variable must be set before typing `\\[decipher]'.")
|
||||
This variable must be set before typing `\\[decipher]'."
|
||||
:type 'boolean
|
||||
:group 'decipher)
|
||||
|
||||
(defvar decipher-ignore-spaces nil
|
||||
|
||||
(defcustom decipher-ignore-spaces nil
|
||||
"*Non-nil means to ignore spaces and punctuation when counting digrams.
|
||||
You should set this to `nil' if the cipher message is divided into words,
|
||||
or `t' if it is not.
|
||||
This variable is buffer-local.")
|
||||
This variable is buffer-local."
|
||||
:type 'boolean
|
||||
:group 'decipher)
|
||||
(make-variable-buffer-local 'decipher-ignore-spaces)
|
||||
|
||||
(defvar decipher-undo-limit 5000
|
||||
(defcustom decipher-undo-limit 5000
|
||||
"The maximum number of entries in the undo list.
|
||||
When the undo list exceeds this number, 100 entries are deleted from
|
||||
the tail of the list.")
|
||||
the tail of the list."
|
||||
:type 'integer
|
||||
:group 'decipher)
|
||||
|
||||
(defcustom decipher-mode-hook nil
|
||||
"Hook to run upon entry to decipher."
|
||||
:type 'hook
|
||||
:group 'decipher)
|
||||
|
||||
;; End of user modifiable variables
|
||||
;;--------------------------------------------------------------------
|
||||
|
|
|
@ -33,9 +33,15 @@
|
|||
;;; The log file should be set for your system, and it must
|
||||
;;; be writable by all.
|
||||
|
||||
(defgroup dunnet nil
|
||||
"Text adventure for Emacs."
|
||||
:prefix "dun-"
|
||||
:group 'games)
|
||||
|
||||
(defvar dun-log-file "/usr/local/dunnet.score"
|
||||
"Name of file to store score information for dunnet.")
|
||||
(defcustom dun-log-file "/usr/local/dunnet.score"
|
||||
"Name of file to store score information for dunnet."
|
||||
:type 'file
|
||||
:group 'dunnet)
|
||||
|
||||
(if nil
|
||||
(eval-and-compile (setq byte-compile-warnings nil)))
|
||||
|
|
|
@ -90,33 +90,48 @@
|
|||
|
||||
;;;; Configuration variables
|
||||
|
||||
(defvar gametree-half-ply-regexp (regexp-quote ":")
|
||||
(defgroup gametree nil
|
||||
"Manage game analysis trees in Emacs."
|
||||
:prefix "gametree-"
|
||||
:group 'games)
|
||||
|
||||
(defcustom gametree-half-ply-regexp (regexp-quote ":")
|
||||
"*Matches ends of numbers of moves by the \"second\" player.
|
||||
For instance, it is an almost universal convention in chess to postfix
|
||||
numbers of moves by Black (if considered in isolation) by the ellipsis
|
||||
\"...\". This is NOT a good choice for this program, though, because it
|
||||
conflicts with the use of ellipsis by Outline mode to denote collapsed
|
||||
subtrees. The author uses \":\" because it agrees nicely with a set of
|
||||
LaTeX macros he uses for typesetting annotated games.")
|
||||
LaTeX macros he uses for typesetting annotated games."
|
||||
:type 'regexp
|
||||
:group 'gametree)
|
||||
|
||||
(defvar gametree-full-ply-regexp (regexp-quote ".")
|
||||
(defcustom gametree-full-ply-regexp (regexp-quote ".")
|
||||
"*Matches ends of numbers of moves by the \"first\" player.
|
||||
For instance, it is an almost universal convention in chess to postfix
|
||||
numbers of moves by White (if considered in isolation) by the dot \".\".")
|
||||
numbers of moves by White (if considered in isolation) by the dot \".\"."
|
||||
:type 'regexp
|
||||
:group 'gametree)
|
||||
|
||||
(defvar gametree-half-ply-format "%d:"
|
||||
(defcustom gametree-half-ply-format "%d:"
|
||||
"*Output format for move numbers of moves by the \"second\" player.
|
||||
Has to contain \"%d\" to output the actual number.")
|
||||
Has to contain \"%d\" to output the actual number."
|
||||
:type 'string
|
||||
:group 'gametree)
|
||||
|
||||
(defvar gametree-full-ply-format "%d."
|
||||
(defcustom gametree-full-ply-format "%d."
|
||||
"*Output format for move numbers of moves by the \"first\" player.
|
||||
Has to contain \"%d\" to output the actual number.")
|
||||
Has to contain \"%d\" to output the actual number."
|
||||
:type 'string
|
||||
:group 'gametree)
|
||||
|
||||
(defvar gametree-make-heading-function
|
||||
(defcustom gametree-make-heading-function
|
||||
(function (lambda (level)
|
||||
(insert (make-string level ?*))))
|
||||
"A function of one numeric argument, LEVEL, to insert a heading at point.
|
||||
You should change this if you change `outline-regexp'.")
|
||||
You should change this if you change `outline-regexp'."
|
||||
:type 'function
|
||||
:group 'gametree)
|
||||
|
||||
(defvar gametree-local-layout nil
|
||||
"A list encoding the layout (i.e. the show or hide state) of the file.
|
||||
|
|
|
@ -66,11 +66,18 @@
|
|||
|
||||
;;; Code:
|
||||
|
||||
(defgroup gomoku nil
|
||||
"Gomoku game between you and Emacs."
|
||||
:prefix "gomoku-"
|
||||
:group 'games)
|
||||
;;;
|
||||
;;; GOMOKU MODE AND KEYMAP.
|
||||
;;;
|
||||
(defvar gomoku-mode-hook nil
|
||||
"If non-nil, its value is called on entry to Gomoku mode.")
|
||||
(defcustom gomoku-mode-hook nil
|
||||
"If non-nil, its value is called on entry to Gomoku mode.
|
||||
One useful value to include is `turn-on-font-lock' to highlight the pieces."
|
||||
:type 'hook
|
||||
:group 'gomoku)
|
||||
|
||||
(defvar gomoku-mode-map nil
|
||||
"Local keymap to use in Gomoku mode.")
|
||||
|
@ -133,17 +140,21 @@
|
|||
gomoku-mode-map (current-global-map)))
|
||||
|
||||
(defvar gomoku-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.")
|
||||
|
||||
(defvar gomoku-font-lock-O-face
|
||||
(defcustom gomoku-font-lock-O-face
|
||||
(if window-system
|
||||
(list (facemenu-get-face 'fg:red) 'bold))
|
||||
"*Face to use for Emacs' O.")
|
||||
"*Face to use for Emacs' O."
|
||||
:type '(repeat face)
|
||||
:group 'gomoku)
|
||||
|
||||
(defvar gomoku-font-lock-X-face
|
||||
(defcustom gomoku-font-lock-X-face
|
||||
(if window-system
|
||||
(list (facemenu-get-face 'fg:green) 'bold))
|
||||
"*Face to use for your X.")
|
||||
"*Face to use for your X."
|
||||
:type '(repeat face)
|
||||
:group 'gomoku)
|
||||
|
||||
(defvar gomoku-font-lock-keywords
|
||||
'(("O" . gomoku-font-lock-O-face)
|
||||
|
|
|
@ -72,6 +72,11 @@
|
|||
|
||||
;; Variables
|
||||
|
||||
(defgroup handwrite nil
|
||||
"Turns your emacs buffer into a handwritten document."
|
||||
:prefix "handwrite-"
|
||||
:group 'games)
|
||||
|
||||
(defvar handwrite-psindex 0
|
||||
"The index of the PostScript buffer.")
|
||||
(defvar menu-bar-handwrite-map (make-sparse-keymap "Handwrite functions."))
|
||||
|
@ -80,27 +85,46 @@
|
|||
|
||||
;; User definable variables
|
||||
|
||||
(defvar handwrite-numlines 60
|
||||
"*The number of lines on a page of the PostScript output from `handwrite'.")
|
||||
(defvar handwrite-fontsize 11
|
||||
"*The size of the font for the PostScript output from `handwrite'.")
|
||||
(defvar handwrite-linespace 12
|
||||
"*The spacing for the PostScript output from `handwrite'.")
|
||||
(defvar handwrite-xstart 30
|
||||
"*X-axis translation in the PostScript output from `handwrite'.")
|
||||
(defvar handwrite-ystart 810
|
||||
"*Y-axis translation in the PostScript output from `handwrite'.")
|
||||
(defvar handwrite-pagenumbering nil
|
||||
"*If non-nil, number each page of the PostScript output from `handwrite'.")
|
||||
(defvar handwrite-10pt-numlines 65
|
||||
"*The number of lines on a page for the function `handwrite-10pt'.")
|
||||
(defvar handwrite-11pt-numlines 60
|
||||
"*The number of lines on a page for the function `handwrite-11pt'.")
|
||||
(defvar handwrite-12pt-numlines 55
|
||||
"*The number of lines on a page for the function `handwrite-12pt'.")
|
||||
(defvar handwrite-13pt-numlines 50
|
||||
"*The number of lines on a page for the function `handwrite-13pt'.")
|
||||
|
||||
(defcustom handwrite-numlines 60
|
||||
"*The number of lines on a page of the PostScript output from `handwrite'."
|
||||
:type 'integer
|
||||
:group 'handwrite)
|
||||
(defcustom handwrite-fontsize 11
|
||||
"*The size of the font for the PostScript output from `handwrite'."
|
||||
:type 'integer
|
||||
:group 'handwrite)
|
||||
(defcustom handwrite-linespace 12
|
||||
"*The spacing for the PostScript output from `handwrite'."
|
||||
:type 'integer
|
||||
:group 'handwrite)
|
||||
(defcustom handwrite-xstart 30
|
||||
"*X-axis translation in the PostScript output from `handwrite'."
|
||||
:type 'integer
|
||||
:group 'handwrite)
|
||||
(defcustom handwrite-ystart 810
|
||||
"*Y-axis translation in the PostScript output from `handwrite'."
|
||||
:type 'integer
|
||||
:group 'handwrite)
|
||||
(defcustom handwrite-pagenumbering nil
|
||||
"*If non-nil, number each page of the PostScript output from `handwrite'."
|
||||
:type 'boolean
|
||||
:group 'handwrite)
|
||||
(defcustom handwrite-10pt-numlines 65
|
||||
"*The number of lines on a page for the function `handwrite-10pt'."
|
||||
:type 'integer
|
||||
:group 'handwrite)
|
||||
(defcustom handwrite-11pt-numlines 60
|
||||
"*The number of lines on a page for the function `handwrite-11pt'."
|
||||
:type 'integer
|
||||
:group 'handwrite)
|
||||
(defcustom handwrite-12pt-numlines 55
|
||||
"*The number of lines on a page for the function `handwrite-12pt'."
|
||||
:type 'integer
|
||||
:group 'handwrite)
|
||||
(defcustom handwrite-13pt-numlines 50
|
||||
"*The number of lines on a page for the function `handwrite-13pt'."
|
||||
:type 'integer
|
||||
:group 'handwrite)
|
||||
|
||||
;; Interactive functions
|
||||
|
||||
|
|
|
@ -68,6 +68,11 @@
|
|||
|
||||
;;;_* From Gomoku
|
||||
|
||||
(defgroup lm nil
|
||||
"Neural-network robot that learns landmarks."
|
||||
:prefix "lm-"
|
||||
:group 'games)
|
||||
|
||||
;;;_ + THE BOARD.
|
||||
|
||||
;; The board is a rectangular grid. We code empty squares with 0, X's with 1
|
||||
|
@ -154,8 +159,10 @@
|
|||
|
||||
;;;_ + LM MODE AND KEYMAP.
|
||||
|
||||
(defvar lm-mode-hook nil
|
||||
"If non-nil, its value is called on entry to Lm mode.")
|
||||
(defcustom lm-mode-hook nil
|
||||
"If non-nil, its value is called on entry to Lm mode."
|
||||
:type 'hook
|
||||
:group 'lm)
|
||||
|
||||
(defvar lm-mode-map nil
|
||||
"Local keymap to use in Lm mode.")
|
||||
|
@ -1123,12 +1130,16 @@ this program to add a random element to the way moves were made.")
|
|||
;;;(setq lm-debug nil)
|
||||
(defvar lm-debug nil
|
||||
"If non-nil, debugging is printed.")
|
||||
(defvar lm-one-moment-please nil
|
||||
(defcustom lm-one-moment-please nil
|
||||
"If non-nil, print \"One moment please\" when a new board is generated.
|
||||
The drawback of this is you don't see how many moves the last run took
|
||||
because it is overwritten by \"One moment please\".")
|
||||
(defvar lm-output-moves t
|
||||
"If non-nil, output number of moves so far on a move-by-move basis.")
|
||||
because it is overwritten by \"One moment please\"."
|
||||
:type 'boolean
|
||||
:group 'lm)
|
||||
(defcustom lm-output-moves t
|
||||
"If non-nil, output number of moves so far on a move-by-move basis."
|
||||
:type 'boolean
|
||||
:group 'lm)
|
||||
|
||||
|
||||
(defun lm-weights-debug ()
|
||||
|
@ -1252,22 +1263,32 @@ because it is overwritten by \"One moment please\".")
|
|||
(mapc 'lm-print-wts-int lm-directions))
|
||||
|
||||
;;;_ - learning parameters
|
||||
(defvar lm-bound 0.005
|
||||
"The maximum that w0j may be.")
|
||||
(defvar lm-c 1.0
|
||||
(defcustom lm-bound 0.005
|
||||
"The maximum that w0j may be."
|
||||
:type 'number
|
||||
:group 'lm)
|
||||
(defcustom lm-c 1.0
|
||||
"A factor applied to modulate the increase in wij.
|
||||
Used in the function lm-update-normal-weights.")
|
||||
(defvar lm-c-naught 0.5
|
||||
Used in the function lm-update-normal-weights."
|
||||
:type 'number
|
||||
:group 'lm)
|
||||
(defcustom lm-c-naught 0.5
|
||||
"A factor applied to modulate the increase in w0j.
|
||||
Used in the function lm-update-naught-weights.")
|
||||
Used in the function lm-update-naught-weights."
|
||||
:type 'number
|
||||
:group 'lm)
|
||||
(defvar lm-initial-w0 0.0)
|
||||
(defvar lm-initial-wij 0.0)
|
||||
(defvar lm-no-payoff 0
|
||||
(defcustom lm-no-payoff 0
|
||||
"The amount of simulation cycles that have occurred with no movement.
|
||||
Used to move the robot when he is stuck in a rut for some reason.")
|
||||
(defvar lm-max-stall-time 2
|
||||
Used to move the robot when he is stuck in a rut for some reason."
|
||||
:type 'integer
|
||||
:group 'lm)
|
||||
(defcustom lm-max-stall-time 2
|
||||
"The maximum number of cycles that the robot can remain stuck in a place.
|
||||
After this limit is reached, lm-random-move is called to push him out of it.")
|
||||
After this limit is reached, lm-random-move is called to push him out of it."
|
||||
:type 'integer
|
||||
:group 'lm)
|
||||
|
||||
|
||||
;;;_ + Randomizing functions
|
||||
|
|
|
@ -31,10 +31,17 @@
|
|||
|
||||
;;; Code:
|
||||
|
||||
(defgroup mpuz nil
|
||||
"Multiplication puzzle."
|
||||
:prefix "mpuz-"
|
||||
:group 'games)
|
||||
|
||||
(random t) ; randomize
|
||||
|
||||
(defvar mpuz-silent nil
|
||||
"*Set this to T if you don't want dings on inputs.")
|
||||
(defcustom mpuz-silent nil
|
||||
"*Set this to T if you don't want dings on inputs."
|
||||
:type 'boolean
|
||||
:group 'mpuz)
|
||||
|
||||
(defun mpuz-ding ()
|
||||
"Dings, unless global variable `mpuz-silent' forbids it."
|
||||
|
@ -43,7 +50,10 @@
|
|||
|
||||
;; Mpuz mode and keymaps
|
||||
;;----------------------
|
||||
(defvar mpuz-mode-hook nil)
|
||||
(defcustom mpuz-mode-hook nil
|
||||
"Hook to run upon entry to mpuz."
|
||||
:type 'hook
|
||||
:group 'mpuz)
|
||||
|
||||
(defvar mpuz-mode-map nil
|
||||
"Local keymap to use in Mult Puzzle.")
|
||||
|
|
|
@ -33,9 +33,19 @@
|
|||
|
||||
;;; Code:
|
||||
|
||||
(defgroup solitaire nil
|
||||
"Game of solitaire."
|
||||
:prefix "solitaire-"
|
||||
:group 'games)
|
||||
|
||||
(defvar solitaire-mode-map nil
|
||||
"Keymap for playing solitaire.")
|
||||
|
||||
(defcustom solitaire-mode-hook nil
|
||||
"Hook to run upon entry to solitaire."
|
||||
:type 'hook
|
||||
:group 'solitaire)
|
||||
|
||||
(if solitaire-mode-map
|
||||
()
|
||||
(setq solitaire-mode-map (make-sparse-keymap))
|
||||
|
@ -116,10 +126,12 @@ The usual mnemonic keys move the cursor around the board; in addition,
|
|||
(defvar solitaire-end-x nil)
|
||||
(defvar solitaire-end-y nil)
|
||||
|
||||
(defvar solitaire-auto-eval t
|
||||
(defcustom solitaire-auto-eval t
|
||||
"*Non-nil means check for possible moves after each major change.
|
||||
This takes a while, so switch this on if you like to be informed when
|
||||
the game is over, or off, if you are working on a slow machine.")
|
||||
the game is over, or off, if you are working on a slow machine."
|
||||
:type 'boolean
|
||||
:group 'solitaire)
|
||||
|
||||
(defconst solitaire-valid-directions
|
||||
'(solitaire-left solitaire-right solitaire-up solitaire-down))
|
||||
|
@ -134,7 +146,7 @@ Move around the board using the cursor keys.
|
|||
Move stones using \\[solitaire-move] followed by a direction key.
|
||||
Undo moves using \\[solitaire-undo].
|
||||
Check for possible moves using \\[solitaire-do-check].
|
||||
\(The variable solitaire-auto-eval controls whether to automatically
|
||||
\(The variable `solitaire-auto-eval' controls whether to automatically
|
||||
check after each move or undo)
|
||||
|
||||
What is Solitaire?
|
||||
|
|
|
@ -40,11 +40,20 @@
|
|||
(require 'cookie1)
|
||||
|
||||
; Variables
|
||||
(defvar spook-phrases-file (concat data-directory "spook.lines")
|
||||
"Keep your favorite phrases here.")
|
||||
(defgroup spook nil
|
||||
"Spook phrase utility for overloading the NSA line eater."
|
||||
:prefix "spook-"
|
||||
:group 'games)
|
||||
|
||||
(defvar spook-phrase-default-count 15
|
||||
"Default number of phrases to insert")
|
||||
(defcustom spook-phrases-file (concat data-directory "spook.lines")
|
||||
"Keep your favorite phrases here."
|
||||
:type 'file
|
||||
:group 'spook)
|
||||
|
||||
(defcustom spook-phrase-default-count 15
|
||||
"Default number of phrases to insert."
|
||||
:type 'integer
|
||||
:group 'spook)
|
||||
|
||||
;;;###autoload
|
||||
(defun spook ()
|
||||
|
|
|
@ -35,8 +35,15 @@
|
|||
|
||||
(require 'cookie1)
|
||||
|
||||
(defvar yow-file (concat data-directory "yow.lines")
|
||||
"File containing pertinent pinhead phrases.")
|
||||
(defgroup yow nil
|
||||
"Quote random zippyisms."
|
||||
:prefix "yow-"
|
||||
:group 'games)
|
||||
|
||||
(defcustom yow-file (concat data-directory "yow.lines")
|
||||
"File containing pertinent pinhead phrases."
|
||||
:type 'file
|
||||
:group 'yow)
|
||||
|
||||
(defconst yow-load-message "Am I CONSING yet?...")
|
||||
(defconst yow-after-load-message "I have SEEN the CONSING!!")
|
||||
|
|
Loading…
Reference in a new issue