72
|
1 ;;; flame.el --- Automated insults
|
|
2
|
|
3 ;; Copyright status Unknown
|
|
4
|
|
5 ;; Author: Unknown
|
|
6 ;; Adapted-By: Ian G. Batten, Batten@uk.ac.bham.multics
|
|
7 ;; Keywords: games
|
|
8
|
|
9 ;; This file is part of XEmacs.
|
|
10
|
|
11 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
12 ;; under the terms of the GNU General Public License as published by
|
|
13 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
14 ;; any later version.
|
|
15
|
|
16 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
19 ;; General Public License for more details.
|
|
20
|
|
21 ;; You should have received a copy of the GNU General Public License
|
|
22 ;; along with XEmacs; see the file COPYING. If not, write to the Free
|
|
23 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
24 ;; 02111-1307, USA.
|
|
25
|
|
26 ;;; Synched up with: Not in FSF
|
|
27
|
|
28 ;;; Commentary:
|
|
29
|
0
|
30 ;;; "Flame" program. This has a chequered past.
|
|
31 ;;;
|
|
32 ;;; The original was on a Motorola 286 running Vanilla V.1,
|
|
33 ;;; about 2 years ago. It was couched in terms of a yacc (I think)
|
|
34 ;;; script. I pulled the data out of it and rewrote it as a piece
|
|
35 ;;; of PL/1 on Multics. Now I've moved it into an emacs-lisp
|
|
36 ;;; form. If the original author cares to contact me, I'd
|
|
37 ;;; be very happy to credit you!
|
|
38 ;;;
|
|
39 ;;; Ian G. Batten, Batten@uk.ac.bham.multics
|
|
40 ;;;
|
|
41
|
72
|
42 ;;; Code:
|
0
|
43 (random t)
|
|
44
|
|
45 (defvar sentence
|
|
46 '((how can you say that (statement) \?)
|
|
47 (I can\'t believe how (adjective) you are\.)
|
|
48 (only a (der-term) like you would say that (statement) \.)
|
|
49 ((statement) \, huh\?) (so\, (statement) \?)
|
|
50 ((statement) \, right\?) (I mean\, (sentence))
|
|
51 (don\'t you realise that (statement) \?)
|
|
52 (I firmly believe that (statement) \.)
|
|
53 (let me tell you something\, you (der-term) \, (statement) \.)
|
|
54 (furthermore\, you (der-term) \, (statement) \.)
|
|
55 (I couldn\'t care less about your (thing) \.)
|
|
56 (How can you be so (adjective) \?)
|
|
57 (you make me sick\.)
|
|
58 (it\'s well known that (statement) \.)
|
|
59 ((statement) \.)
|
|
60 (it takes a (group-adj) (der-term) like you to say that (statement) \.)
|
|
61 (I don\'t want to hear about your (thing) \.)
|
|
62 (you\'re always totally wrong\.)
|
|
63 (I\'ve never heard anything as ridiculous as the idea that (statement) \.)
|
|
64 (you must be a real (der-term) to think that (statement) \.)
|
|
65 (you (adjective) (group-adj) (der-term) \!)
|
|
66 (you\'re probably (group-adj) yourself\.)
|
|
67 (you sound like a real (der-term) \.)
|
|
68 (why\, (statement) \!)
|
|
69 (I have many (group-adj) friends\.)
|
|
70 (save the (thing) s\!) (no nukes\!) (ban (thing) s\!)
|
|
71 (I\'ll bet you think that (thing) s are (adjective) \.)
|
|
72 (you know\, (statement) \.)
|
|
73 (your (quality) reminds me of a (thing) \.)
|
|
74 (you have the (quality) of a (der-term) \.)
|
|
75 ((der-term) \!)
|
|
76 ((adjective) (group-adj) (der-term) \!)
|
|
77 (you\'re a typical (group-adj) person\, totally (adjective) \.)
|
|
78 (man\, (sentence))))
|
|
79
|
|
80 (defvar sentence-loop (nconc sentence sentence))
|
|
81
|
|
82
|
|
83 (defvar quality
|
|
84 '((ignorance) (stupidity) (worthlessness)
|
|
85 (prejudice) (lack of intelligence) (lousiness)
|
|
86 (bad grammar) (lousy spelling)
|
|
87 (lack of common decency) (ugliness) (nastiness)
|
|
88 (subtlety) (dishonesty) ((adjective) (quality))))
|
|
89
|
|
90
|
|
91 (defvar quality-loop (nconc quality quality))
|
|
92
|
|
93 (defvar adjective
|
|
94 '((ignorant) (crass) (pathetic) (sick)
|
|
95 (bloated) (malignant) (perverted) (sadistic)
|
|
96 (stupid) (unpleasant) (lousy) (abusive) (bad)
|
|
97 (braindamaged) (selfish) (improper) (nasty)
|
|
98 (disgusting) (foul) (intolerable) (primitive)
|
|
99 (depressing) (dumb) (phoney)
|
|
100 ((adjective) and (adjective))
|
|
101 (as (adjective) as a (thing))))
|
|
102
|
|
103 (defvar adjective-loop (nconc adjective adjective))
|
|
104
|
|
105 (defvar der-term
|
|
106 '(((adjective) (der-term)) (sexist) (fascist)
|
|
107 (weakling) (coward) (beast) (peasant) (racist)
|
|
108 (cretin) (fool) (jerk) (ignoramus) (idiot)
|
|
109 (wanker) (rat) (slimebag) (DAF driver)
|
|
110 (Neanderthal) (sadist) (drunk) (capitalist)
|
|
111 (wimp) (dogmatist) (wally) (maniac)
|
|
112 (whimpering scumbag) (pea brain) (arsehole)
|
|
113 (moron) (goof) (incompetent) (lunkhead) (Nazi)
|
|
114 (SysThug) ((der-term) (der-term))))
|
|
115
|
|
116 (defvar der-term-loop (nconc der-term der-term))
|
|
117
|
|
118
|
|
119 (defvar thing
|
|
120 '(((adjective) (thing)) (computer)
|
|
121 (Honeywell dps8) (whale) (operation)
|
|
122 (sexist joke) (ten-incher) (dog) (MicroVAX II)
|
|
123 (source license) (real-time clock)
|
|
124 (mental problem) (sexual fantasy)
|
|
125 (venereal disease) (Jewish grandmother)
|
|
126 (cardboard cut-out) (punk haircut) (surfboard)
|
|
127 (system call) (wood-burning stove)
|
|
128 (graphics editor) (right wing death squad)
|
|
129 (disease) (vegetable) (religion)
|
|
130 (cruise missile) (bug fix) (lawyer) (copyright)
|
|
131 (PAD)))
|
|
132
|
|
133 (defvar thing-loop (nconc thing thing))
|
|
134
|
|
135
|
|
136 (defvar group-adj
|
|
137 '((gay) (old) (lesbian) (young) (black)
|
|
138 (Polish) ((adjective)) (white)
|
|
139 (mentally retarded) (Nicaraguan) (homosexual)
|
|
140 (dead) (underpriviledged) (religious)
|
|
141 ((thing) \-loving) (feminist) (foreign)
|
|
142 (intellectual) (crazy) (working) (unborn)
|
|
143 (Chinese) (short) ((adjective)) (poor) (rich)
|
|
144 (funny-looking) (Puerto Rican) (Mexican)
|
|
145 (Italian) (communist) (fascist) (Iranian)
|
|
146 (Moonie)))
|
|
147
|
|
148 (defvar group-adj-loop (nconc group-adj group-adj))
|
|
149
|
|
150 (defvar statement
|
|
151 '((your (thing) is great) ((thing) s are fun)
|
|
152 ((person) is a (der-term))
|
|
153 ((group-adj) people are (adjective))
|
|
154 (every (group-adj) person is a (der-term))
|
|
155 (most (group-adj) people have (thing) s)
|
|
156 (all (group-adj) dudes should get (thing) s)
|
|
157 ((person) is (group-adj)) (trees are (adjective))
|
|
158 (if you\'ve seen one (thing) \, you\'ve seen them all)
|
|
159 (you\'re (group-adj)) (you have a (thing))
|
|
160 (my (thing) is pretty good)
|
|
161 (the Martians are coming)
|
|
162 (the (paper) is always right)
|
|
163 (just because you read it in the (paper) that doesn\'t mean it\'s true)
|
|
164 ((person) was (group-adj))
|
|
165 ((person) \'s ghost is living in your (thing))
|
|
166 (you look like a (thing))
|
|
167 (the oceans are full of dirty fish)
|
|
168 (people are dying every day)
|
|
169 (a (group-adj) man ain\'t got nothing in the world these days)
|
|
170 (women are inherently superior to men)
|
|
171 (the system staff is fascist)
|
|
172 (there is life after death)
|
|
173 (the world is full of (der-term) s)
|
|
174 (you remind me of (person)) (technology is evil)
|
|
175 ((person) killed (person))
|
|
176 (the Russians are tapping your phone)
|
|
177 (the Earth is flat)
|
|
178 (it\'s OK to run down (group-adj) people)
|
|
179 (Multics is a really (adjective) operating system)
|
|
180 (the CIA killed (person))
|
|
181 (the sexual revolution is over)
|
|
182 (Lassie was (group-adj))
|
|
183 (the (group-adj) people have really got it all together)
|
|
184 (I was (person) in a previous life)
|
|
185 (breathing causes cancer)
|
|
186 (it\'s fun to be really (adjective))
|
|
187 ((quality) is pretty fun) (you\'re a (der-term))
|
|
188 (the (group-adj) culture is fascinating)
|
|
189 (when ya gotta go ya gotta go)
|
|
190 ((person) is (adjective))
|
|
191 ((person) \'s (quality) is (adjective))
|
|
192 (it\'s a wonderful day)
|
|
193 (everything is really a (thing))
|
|
194 (there\'s a (thing) in (person) \'s brain)
|
|
195 ((person) is a cool dude)
|
|
196 ((person) is just a figment of your imagination)
|
|
197 (the more (thing) s you have, the better)
|
|
198 (life is a (thing)) (life is (quality))
|
|
199 ((person) is (adjective))
|
|
200 ((group-adj) people are all (adjective) (der-term) s)
|
|
201 ((statement) \, and (statement))
|
|
202 ((statement) \, but (statement))
|
|
203 (I wish I had a (thing))
|
|
204 (you should have a (thing))
|
|
205 (you hope that (statement))
|
|
206 ((person) is secretly (group-adj))
|
|
207 (you wish you were (group-adj))
|
|
208 (you wish you were a (thing))
|
|
209 (I wish I were a (thing))
|
|
210 (you think that (statement))
|
|
211 ((statement) \, because (statement))
|
|
212 ((group-adj) people don\'t get married to (group-adj) people because (reason))
|
|
213 ((group-adj) people are all (adjective) because (reason))
|
|
214 ((group-adj) people are (adjective) \, and (reason))
|
|
215 (you must be a (adjective) (der-term) to think that (person) said (statement))
|
|
216 ((group-adj) people are inherently superior to (group-adj) people)
|
|
217 (God is Dead)))
|
|
218
|
|
219 (defvar statement-loop (nconc statement statement))
|
|
220
|
|
221
|
|
222 (defvar paper
|
|
223 '((Daily Mail) (Daily Express)
|
|
224 (Centre Bulletin) (Sun) (Daily Mirror) (Pravda)
|
|
225 (Daily Telegraph) (Beano) (Multics Manual)))
|
|
226
|
|
227 (defvar paper-loop (nconc paper paper))
|
|
228
|
|
229
|
|
230 (defvar person
|
|
231 '((Reagan) (Ken Thompson) (Dennis Ritchie)
|
|
232 (JFK) (the Pope) (Gadaffi) (Napoleon)
|
|
233 (Karl Marx) (Groucho) (Michael Jackson)
|
|
234 (Caesar) (Nietzsche) (Heidegger) (\"Head-for-the-mountains\" Bush)
|
|
235 (Henry Kissinger) (Nixon) (Castro) (Thatcher)
|
|
236 (Attilla the Hun) (Alaric the Visigoth) (Hitler)))
|
|
237
|
|
238 (defvar person-loop (nconc person person))
|
|
239
|
|
240 (defvar reason
|
|
241 '((they don\'t want their children to grow up to be too lazy to steal)
|
|
242 (they can\'t tell them apart from (group-adj) dudes)
|
|
243 (they\'re too (adjective))
|
|
244 ((person) wouldn\'t have done it)
|
|
245 (they can\'t spray paint that small)
|
|
246 (they don\'t have (thing) s) (they don\'t know how)
|
|
247 (they can\'t afford (thing) s)))
|
|
248
|
|
249 (defvar reason-loop (nconc reason reason))
|
|
250
|
|
251 (defmacro define-element (name)
|
|
252 (let ((loop-to-use (intern (concat name "-loop"))))
|
|
253 (` (defun (, (intern name)) nil
|
|
254 (let ((step-forward (random 10)))
|
|
255 (if (< step-forward 0) (setq step-forward (- step-forward)))
|
|
256 (prog1
|
|
257 (nth step-forward (, loop-to-use))
|
|
258 (setq (, loop-to-use) (nthcdr (1+ step-forward) (, loop-to-use)))))))))
|
|
259
|
|
260 (define-element "sentence")
|
|
261 (define-element "quality")
|
|
262 (define-element "adjective")
|
|
263 (define-element "der-term")
|
|
264 (define-element "group-adj")
|
|
265 (define-element "statement")
|
|
266 (define-element "thing")
|
|
267 (define-element "paper")
|
|
268 (define-element "person")
|
|
269 (define-element "reason")
|
|
270
|
|
271 (defun *flame nil
|
|
272 (flame-expand '(sentence)))
|
|
273
|
|
274 (defun flame-expand (object)
|
|
275 (cond ((atom object)
|
|
276 object)
|
|
277 (t (mapcar 'flame-expand (funcall (car object))))))
|
|
278
|
|
279 (defun flatten (list)
|
|
280 (cond ((atom list)
|
|
281 (list list))
|
|
282 (t (apply 'append (mapcar 'flatten list)))))
|
|
283
|
|
284 ;;;###autoload
|
|
285 (defun flame (arg)
|
|
286 "Generate ARG (default 1) sentences of half-crazed gibberish."
|
|
287 (interactive "p")
|
|
288 (let ((w (selected-window)))
|
|
289 (pop-to-buffer (get-buffer-create "*Flame*"))
|
|
290 (goto-char (point-max))
|
|
291 (insert ?\n)
|
|
292 (flame2 arg)
|
|
293 (select-window w)))
|
|
294
|
|
295 (defun flame2 (arg)
|
|
296 (let ((start (point)))
|
|
297 (flame1 arg)
|
|
298 (fill-region-as-paragraph start (point) t)))
|
|
299
|
|
300 (defun flame1 (arg)
|
|
301 (cond ((zerop arg) t)
|
|
302 (t (insert (concat (sentence-ify (string-ify (append-suffixes-hack (flatten (*flame)))))))
|
|
303 (flame1 (1- arg)))))
|
|
304
|
|
305 (defun sentence-ify (string)
|
|
306 (concat (upcase (substring string 0 1))
|
|
307 (substring string 1 (length string))
|
|
308 " "))
|
|
309
|
|
310 (defun string-ify (list)
|
|
311 (mapconcat
|
|
312 'symbol-name
|
|
313 ; '(lambda (x)
|
|
314 ; (format "%s" x))
|
|
315 list
|
|
316 " "))
|
|
317
|
|
318 (defun append-suffixes-hack (list)
|
|
319 (cond ((null list)
|
|
320 nil)
|
|
321 ((memq (nth 1 list)
|
|
322 '(\? \. \, s\! \! s \'s \-loving))
|
|
323 (cons (intern (concat (symbol-name (nth 0 list))
|
|
324 (symbol-name (nth 1 list))))
|
|
325 ;;(intern (format "%s%s" (nth 0 list) (nth 1 list)))
|
|
326 (append-suffixes-hack (nthcdr 2 list))))
|
|
327 (t (cons (nth 0 list)
|
|
328 (append-suffixes-hack (nthcdr 1 list))))))
|
|
329
|
|
330 (defun psychoanalyze-flamer ()
|
|
331 "Mr. Angry goes to the analyst."
|
|
332 (interactive)
|
|
333 (doctor) ; start the psychotherapy
|
|
334 (message "")
|
|
335 (switch-to-buffer "*doctor*")
|
|
336 (sit-for 0)
|
|
337 (while (not (input-pending-p))
|
|
338 (flame2 (if (= (random 2) 0) 2 1))
|
|
339 (sit-for 0)
|
|
340 (doctor-ret-or-read 1)))
|
72
|
341
|
|
342 ;;; flame.el ends here
|