comparison lisp/games/conx.el @ 4:b82b59fe008d r19-15b3

Import from CVS: tag r19-15b3
author cvs
date Mon, 13 Aug 2007 08:46:56 +0200
parents 376386a54a3c
children 131b0175ea99
comparison
equal deleted inserted replaced
3:30df88044ec6 4:b82b59fe008d
1 ;;; -*- Mode:Emacs-Lisp; Blat:Foop -*- 1 ;;; conx.el --- Yet another dissociater
2
3 ;; Copyright status unknown
4
5 ;; Author: Jamie Zawinski <jwz@netscape.com>
6 ;; Keywords: games
7
8 ;; This file is part of XEmacs.
9
10 ;; XEmacs is free software; you can redistribute it and/or modify it
11 ;; under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; any later version.
14
15 ;; XEmacs is distributed in the hope that it will be useful, but
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ;; General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with XEmacs; see the file COPYING. If not, write to the Free
22 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
23 ;; 02111-1307, USA.
24
25 ;;; Synched up with: Not in FSF
26
27 ;;; Commentary:
2 28
3 ;;; conx.el: Yet Another Dissociator. 29 ;;; conx.el: Yet Another Dissociator.
4 ;;; Original design by Skef Wholey <skef@cs.cmu.edu>; 30 ;;; Original design by Skef Wholey <skef@cs.cmu.edu>;
5 ;;; ported to Emacs-Lisp by Jamie Zawinski <jwz@lucid.com>, 5-mar-91. 31 ;;; ported to Emacs-Lisp by Jamie Zawinski <jwz@netscape.com>, 5-mar-91.
6 ;;;
7 (defconst conx-version "1.6, 6-may-94.")
8 ;;;
9 ;;; Run this compiled. It will be an order of magnitude faster. 32 ;;; Run this compiled. It will be an order of magnitude faster.
10 ;;; 33 ;;;
11 ;;; Select a buffer with a lot of text in it. Say M-x conx-buffer 34 ;;; Select a buffer with a lot of text in it. Say M-x conx-buffer
12 ;;; or M-x conx-region. Repeat on as many other bodies of text as 35 ;;; or M-x conx-region. Repeat on as many other bodies of text as
13 ;;; you like. 36 ;;; you like.
44 ;;; contains a sentence randomly generated from the body of the 67 ;;; contains a sentence randomly generated from the body of the
45 ;;; message being replied to. 68 ;;; message being replied to.
46 ;;; 69 ;;;
47 ;;; o It could stand to be faster... 70 ;;; o It could stand to be faster...
48 71
72 ;;; Code:
73 (defconst conx-version "1.6, 6-may-94.")
74
49 (defvar conx-bounce 10) ; 1/x 75 (defvar conx-bounce 10) ; 1/x
50 (defvar conx-hashtable-size 9923) ; 9923 is prime 76 (defvar conx-hashtable-size 9923) ; 9923 is prime
51 (defconst conx-words-hashtable nil) 77 (defconst conx-words-hashtable nil)
52 (defconst conx-words-vector nil) 78 (defconst conx-words-vector nil)
53 (defconst conx-words-vector-fp 0) 79 (defconst conx-words-vector-fp 0)
54 80
55 (defconst conx-last-word nil) 81 (defconst conx-last-word nil)
56 82 p
57 (defvar conx-files nil "FYI") 83 (defvar conx-files nil "FYI")
58 84
59 (defun conx-init () 85 (defun conx-init ()
60 "Forget the current word-frequency tree." 86 "Forget the current word-frequency tree."
61 (interactive) 87 (interactive)
775 (insert (symbol-name x)) 801 (insert (symbol-name x))
776 (insert "\n"))))) 802 (insert "\n")))))
777 conx-words-hashtable) 803 conx-words-hashtable)
778 (sort-numeric-fields -1 (point-min) (point-max))) 804 (sort-numeric-fields -1 (point-min) (point-max)))
779 805
806 ;;; conx.el ends here