comparison lisp/games/conx.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents b82b59fe008d
children b9518feda344
comparison
equal deleted inserted replaced
69:804d1389bcd6 70:131b0175ea99
1 ;;; conx.el --- Yet another dissociater 1 ;;; -*- Mode:Emacs-Lisp; Blat:Foop -*-
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:
28 2
29 ;;; conx.el: Yet Another Dissociator. 3 ;;; conx.el: Yet Another Dissociator.
30 ;;; Original design by Skef Wholey <skef@cs.cmu.edu>; 4 ;;; Original design by Skef Wholey <skef@cs.cmu.edu>;
31 ;;; ported to Emacs-Lisp by Jamie Zawinski <jwz@netscape.com>, 5-mar-91. 5 ;;; ported to Emacs-Lisp by Jamie Zawinski <jwz@lucid.com>, 5-mar-91.
6 ;;;
7 (defconst conx-version "1.6, 6-may-94.")
8 ;;;
32 ;;; Run this compiled. It will be an order of magnitude faster. 9 ;;; Run this compiled. It will be an order of magnitude faster.
33 ;;; 10 ;;;
34 ;;; Select a buffer with a lot of text in it. Say M-x conx-buffer 11 ;;; Select a buffer with a lot of text in it. Say M-x conx-buffer
35 ;;; or M-x conx-region. Repeat on as many other bodies of text as 12 ;;; or M-x conx-region. Repeat on as many other bodies of text as
36 ;;; you like. 13 ;;; you like.
67 ;;; contains a sentence randomly generated from the body of the 44 ;;; contains a sentence randomly generated from the body of the
68 ;;; message being replied to. 45 ;;; message being replied to.
69 ;;; 46 ;;;
70 ;;; o It could stand to be faster... 47 ;;; o It could stand to be faster...
71 48
72 ;;; Code:
73 (defconst conx-version "1.6, 6-may-94.")
74
75 (defvar conx-bounce 10) ; 1/x 49 (defvar conx-bounce 10) ; 1/x
76 (defvar conx-hashtable-size 9923) ; 9923 is prime 50 (defvar conx-hashtable-size 9923) ; 9923 is prime
77 (defconst conx-words-hashtable nil) 51 (defconst conx-words-hashtable nil)
78 (defconst conx-words-vector nil) 52 (defconst conx-words-vector nil)
79 (defconst conx-words-vector-fp 0) 53 (defconst conx-words-vector-fp 0)
80 54
81 (defconst conx-last-word nil) 55 (defconst conx-last-word nil)
82 p 56
83 (defvar conx-files nil "FYI") 57 (defvar conx-files nil "FYI")
84 58
85 (defun conx-init () 59 (defun conx-init ()
86 "Forget the current word-frequency tree." 60 "Forget the current word-frequency tree."
87 (interactive) 61 (interactive)
801 (insert (symbol-name x)) 775 (insert (symbol-name x))
802 (insert "\n"))))) 776 (insert "\n")))))
803 conx-words-hashtable) 777 conx-words-hashtable)
804 (sort-numeric-fields -1 (point-min) (point-max))) 778 (sort-numeric-fields -1 (point-min) (point-max)))
805 779
806 ;;; conx.el ends here