(bubbles-version): Bump value to "0.5".
[bpt/emacs.git] / lisp / play / zone.el
1 ;;; zone.el --- idle display hacks
2
3 ;; Copyright (C) 2000, 2001, 2002, 2003, 2004,
4 ;; 2005, 2006, 2007 Free Software Foundation, Inc.
5
6 ;; Author: Victor Zandy <zandy@cs.wisc.edu>
7 ;; Maintainer: Thien-Thi Nguyen <ttn@gnu.org>
8 ;; Keywords: games
9 ;; Created: June 6, 1998
10
11 ;; This file is part of GNU Emacs.
12
13 ;; GNU Emacs is free software; you can redistribute it and/or modify
14 ;; it under the terms of the GNU General Public License as published by
15 ;; the Free Software Foundation; either version 3, or (at your option)
16 ;; any later version.
17
18 ;; GNU Emacs is distributed in the hope that it will be useful,
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;; GNU General Public License for more details.
22
23 ;; You should have received a copy of the GNU General Public License
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the
25 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
26 ;; Boston, MA 02110-1301, USA.
27
28 ;;; Commentary:
29
30 ;; Don't zone out in front of Emacs! Try M-x zone.
31 ;; If it eventually irritates you, try M-x zone-leave-me-alone.
32
33 ;; Bored by the zone pyrotechnics? Write your own! Add it to
34 ;; `zone-programs'. See `zone-call' for higher-ordered zoning.
35
36 ;; WARNING: Not appropriate for Emacs sessions over modems or
37 ;; computers as slow as mine.
38
39 ;; THANKS: Christopher Mayer, Scott Flinchbaugh,
40 ;; Rachel Kalmar, Max Froumentin, Juri Linkov,
41 ;; Luigi Panzeri, John Paul Wallington.
42
43 ;;; Code:
44
45 (require 'timer)
46 (require 'tabify)
47 (eval-when-compile (require 'cl))
48
49 (defvar zone-timer nil
50 "The timer we use to decide when to zone out, or nil if none.")
51
52 (defvar zone-timeout nil
53 "*Seconds to timeout the zoning.
54 If nil, don't interrupt for about 1^26 seconds.")
55
56 ;; Vector of functions that zone out. `zone' will execute one of
57 ;; these functions, randomly chosen. The chosen function is invoked
58 ;; in the *zone* buffer, which contains the text of the selected
59 ;; window. If the function loops, it *must* periodically check and
60 ;; halt if `input-pending-p' is t (because quitting is disabled when
61 ;; Emacs idle timers are run).
62 (defvar zone-programs [
63 zone-pgm-jitter
64 zone-pgm-putz-with-case
65 zone-pgm-dissolve
66 ;; zone-pgm-explode
67 zone-pgm-whack-chars
68 zone-pgm-rotate
69 zone-pgm-rotate-LR-lockstep
70 zone-pgm-rotate-RL-lockstep
71 zone-pgm-rotate-LR-variable
72 zone-pgm-rotate-RL-variable
73 zone-pgm-drip
74 zone-pgm-drip-fretfully
75 zone-pgm-five-oclock-swan-dive
76 zone-pgm-martini-swan-dive
77 zone-pgm-rat-race
78 zone-pgm-paragraph-spaz
79 zone-pgm-stress
80 zone-pgm-stress-destress
81 zone-pgm-random-life
82 ])
83
84 (defmacro zone-orig (&rest body)
85 `(with-current-buffer (get 'zone 'orig-buffer)
86 ,@body))
87
88 (defmacro zone-hiding-modeline (&rest body)
89 `(let (bg mode-line-fg mode-line-bg mode-line-box)
90 (unwind-protect
91 (progn
92 (when (and (= 0 (get 'zone 'modeline-hidden-level))
93 (display-color-p))
94 (setq bg (face-background 'default)
95 mode-line-box (face-attribute 'mode-line :box)
96 mode-line-fg (face-attribute 'mode-line :foreground)
97 mode-line-bg (face-attribute 'mode-line :background))
98 (set-face-attribute 'mode-line nil
99 :foreground bg
100 :background bg
101 :box nil))
102 (put 'zone 'modeline-hidden-level
103 (1+ (get 'zone 'modeline-hidden-level)))
104 ,@body)
105 (put 'zone 'modeline-hidden-level
106 (1- (get 'zone 'modeline-hidden-level)))
107 (when (and (> 1 (get 'zone 'modeline-hidden-level))
108 mode-line-fg)
109 (set-face-attribute 'mode-line nil
110 :foreground mode-line-fg
111 :background mode-line-bg
112 :box mode-line-box)))))
113
114 (defun zone-call (program &optional timeout)
115 "Call PROGRAM in a zoned way.
116 If PROGRAM is a function, call it, interrupting after the amount
117 of time in seconds specified by optional arg TIMEOUT, or `zone-timeout'
118 if unspecified, q.v.
119 PROGRAM can also be a list of elements, which are interpreted like so:
120 If the element is a function or a list of a function and a number,
121 apply `zone-call' recursively."
122 (cond ((functionp program)
123 (with-timeout ((or timeout zone-timeout (ash 1 26)))
124 (funcall program)))
125 ((listp program)
126 (mapcar (lambda (elem)
127 (cond ((functionp elem) (zone-call elem))
128 ((and (listp elem)
129 (functionp (car elem))
130 (numberp (cadr elem)))
131 (apply 'zone-call elem))
132 (t (error "bad `zone-call' elem: %S" elem))))
133 program))))
134
135 ;;;###autoload
136 (defun zone ()
137 "Zone out, completely."
138 (interactive)
139 (save-window-excursion
140 (let ((f (selected-frame))
141 (outbuf (get-buffer-create "*zone*"))
142 (text (buffer-substring (window-start) (window-end)))
143 (wp (1+ (- (window-point (selected-window))
144 (window-start)))))
145 (put 'zone 'orig-buffer (current-buffer))
146 (put 'zone 'modeline-hidden-level 0)
147 (switch-to-buffer outbuf)
148 (setq mode-name "Zone")
149 (erase-buffer)
150 (setq buffer-undo-list t
151 truncate-lines t
152 tab-width (zone-orig tab-width)
153 line-spacing (zone-orig line-spacing))
154 (insert text)
155 (untabify (point-min) (point-max))
156 (set-window-start (selected-window) (point-min))
157 (set-window-point (selected-window) wp)
158 (sit-for 0 500)
159 (let ((pgm (elt zone-programs (random (length zone-programs))))
160 (ct (and f (frame-parameter f 'cursor-type)))
161 (restore (list '(kill-buffer outbuf))))
162 (when ct
163 (modify-frame-parameters f '((cursor-type . (bar . 0))))
164 (setq restore (cons '(modify-frame-parameters
165 f (list (cons 'cursor-type ct)))
166 restore)))
167 ;; Make `restore' a self-disabling one-shot thunk.
168 (setq restore `(lambda () ,@restore (setq restore nil)))
169 (condition-case nil
170 (progn
171 (message "Zoning... (%s)" pgm)
172 (garbage-collect)
173 ;; If some input is pending, zone says "sorry", which
174 ;; isn't nice; this might happen e.g. when they invoke the
175 ;; game by clicking the menu bar. So discard any pending
176 ;; input before zoning out.
177 (if (input-pending-p)
178 (discard-input))
179 (zone-call pgm)
180 (message "Zoning...sorry"))
181 (error
182 (funcall restore)
183 (while (not (input-pending-p))
184 (message "We were zoning when we wrote %s..." pgm)
185 (sit-for 3)
186 (message "...here's hoping we didn't hose your buffer!")
187 (sit-for 3)))
188 (quit
189 (funcall restore)
190 (ding)
191 (message "Zoning...sorry")))
192 (when restore (funcall restore))))))
193
194 ;;;; Zone when idle, or not.
195
196 (defun zone-when-idle (secs)
197 "Zone out when Emacs has been idle for SECS seconds."
198 (interactive "nHow long before I start zoning (seconds): ")
199 (if (timerp zone-timer)
200 (cancel-timer zone-timer))
201 (setq zone-timer nil)
202 (or (<= secs 0)
203 (setq zone-timer (run-with-idle-timer secs t 'zone))))
204
205 (defun zone-leave-me-alone ()
206 "Don't zone out when Emacs is idle."
207 (interactive)
208 (if (timerp zone-timer)
209 (cancel-timer zone-timer))
210 (setq zone-timer nil)
211 (message "I won't zone out any more"))
212
213
214 ;;;; jittering
215
216 (defun zone-shift-up ()
217 (let* ((b (point))
218 (e (progn (forward-line 1) (point)))
219 (s (buffer-substring b e)))
220 (delete-region b e)
221 (goto-char (point-max))
222 (insert s)))
223
224 (defun zone-shift-down ()
225 (goto-char (point-max))
226 (let* ((b (point))
227 (e (progn (forward-line -1) (point)))
228 (s (buffer-substring b e)))
229 (delete-region b e)
230 (goto-char (point-min))
231 (insert s)))
232
233 (defun zone-shift-left ()
234 (let (s)
235 (while (not (eobp))
236 (unless (eolp)
237 (setq s (buffer-substring (point) (1+ (point))))
238 (delete-char 1)
239 (end-of-line)
240 (insert s))
241 (forward-char 1))))
242
243 (defun zone-shift-right ()
244 (goto-char (point-max))
245 (end-of-line)
246 (let (s)
247 (while (not (bobp))
248 (unless (bolp)
249 (setq s (buffer-substring (1- (point)) (point)))
250 (delete-char -1)
251 (beginning-of-line)
252 (insert s))
253 (end-of-line 0))))
254
255 (defun zone-pgm-jitter ()
256 (let ((ops [
257 zone-shift-left
258 zone-shift-right
259 zone-shift-down
260 zone-shift-up
261 ]))
262 (goto-char (point-min))
263 (while (not (input-pending-p))
264 (funcall (elt ops (random (length ops))))
265 (goto-char (point-min))
266 (sit-for 0 10))))
267
268
269 ;;;; whacking chars
270
271 (defun zone-pgm-whack-chars ()
272 (let ((tbl (copy-sequence (get 'zone-pgm-whack-chars 'wc-tbl))))
273 (while (not (input-pending-p))
274 (let ((i 48))
275 (while (< i 122)
276 (aset tbl i (+ 48 (random (- 123 48))))
277 (setq i (1+ i)))
278 (translate-region (point-min) (point-max) tbl)
279 (sit-for 0 2)))))
280
281 (put 'zone-pgm-whack-chars 'wc-tbl
282 (let ((tbl (make-string 128 ?x))
283 (i 0))
284 (while (< i 128)
285 (aset tbl i i)
286 (setq i (1+ i)))
287 tbl))
288
289 ;;;; dissolving
290
291 (defun zone-remove-text ()
292 (let ((working t))
293 (while working
294 (setq working nil)
295 (save-excursion
296 (goto-char (point-min))
297 (while (not (eobp))
298 (if (looking-at "[^(){}\n\t ]")
299 (let ((n (random 5)))
300 (if (not (= n 0))
301 (progn
302 (setq working t)
303 (forward-char 1))
304 (delete-char 1)
305 (insert " ")))
306 (forward-char 1))))
307 (sit-for 0 2))))
308
309 (defun zone-pgm-dissolve ()
310 (zone-remove-text)
311 (zone-pgm-jitter))
312
313
314 ;;;; exploding
315
316 (defun zone-exploding-remove ()
317 (let ((i 0))
318 (while (< i 5)
319 (save-excursion
320 (goto-char (point-min))
321 (while (not (eobp))
322 (if (looking-at "[^*\n\t ]")
323 (let ((n (random 5)))
324 (if (not (= n 0))
325 (forward-char 1))
326 (insert " ")))
327 (forward-char 1)))
328 (setq i (1+ i))
329 (sit-for 0 2)))
330 (zone-pgm-jitter))
331
332 (defun zone-pgm-explode ()
333 (zone-exploding-remove)
334 (zone-pgm-jitter))
335
336
337 ;;;; putzing w/ case
338
339 ;; Faster than `zone-pgm-putz-with-case', but not as good: all
340 ;; instances of the same letter have the same case, which produces a
341 ;; less interesting effect than you might imagine.
342 (defun zone-pgm-2nd-putz-with-case ()
343 (let ((tbl (make-string 128 ?x))
344 (i 0))
345 (while (< i 128)
346 (aset tbl i i)
347 (setq i (1+ i)))
348 (while (not (input-pending-p))
349 (setq i ?a)
350 (while (<= i ?z)
351 (aset tbl i
352 (if (zerop (random 5))
353 (upcase i)
354 (downcase i)))
355 (setq i (+ i (1+ (random 5)))))
356 (setq i ?A)
357 (while (<= i ?z)
358 (aset tbl i
359 (if (zerop (random 5))
360 (downcase i)
361 (upcase i)))
362 (setq i (+ i (1+ (random 5)))))
363 (translate-region (point-min) (point-max) tbl)
364 (sit-for 0 2))))
365
366 (defun zone-pgm-putz-with-case ()
367 (goto-char (point-min))
368 (while (not (input-pending-p))
369 (let ((np (+ 2 (random 5)))
370 (pm (point-max)))
371 (while (< np pm)
372 (goto-char np)
373 (let ((prec (preceding-char))
374 (props (text-properties-at (1- (point)))))
375 (insert (if (zerop (random 2))
376 (upcase prec)
377 (downcase prec)))
378 (set-text-properties (1- (point)) (point) props))
379 (backward-char 2)
380 (delete-char 1)
381 (setq np (+ np (1+ (random 5))))))
382 (goto-char (point-min))
383 (sit-for 0 2)))
384
385
386 ;;;; rotating
387
388 (defun zone-line-specs ()
389 (let (ret)
390 (save-excursion
391 (goto-char (window-start))
392 (while (< (point) (window-end))
393 (when (looking-at "[\t ]*\\([^\n]+\\)")
394 (setq ret (cons (cons (match-beginning 1) (match-end 1)) ret)))
395 (forward-line 1)))
396 ret))
397
398 (defun zone-pgm-rotate (&optional random-style)
399 (let* ((specs (apply
400 'vector
401 (let (res)
402 (mapcar (lambda (ent)
403 (let* ((beg (car ent))
404 (end (cdr ent))
405 (amt (if random-style
406 (funcall random-style)
407 (- (random 7) 3))))
408 (when (< (- end (abs amt)) beg)
409 (setq amt (random (- end beg))))
410 (unless (= 0 amt)
411 (setq res
412 (cons
413 (vector amt beg (- end (abs amt)))
414 res)))))
415 (zone-line-specs))
416 res)))
417 (n (length specs))
418 amt aamt cut paste txt i ent)
419 (while (not (input-pending-p))
420 (setq i 0)
421 (while (< i n)
422 (setq ent (aref specs i))
423 (setq amt (aref ent 0) aamt (abs amt))
424 (if (> 0 amt)
425 (setq cut 1 paste 2)
426 (setq cut 2 paste 1))
427 (goto-char (aref ent cut))
428 (setq txt (buffer-substring (point) (+ (point) aamt)))
429 (delete-char aamt)
430 (goto-char (aref ent paste))
431 (insert txt)
432 (setq i (1+ i)))
433 (sit-for 0.04))))
434
435 (defun zone-pgm-rotate-LR-lockstep ()
436 (zone-pgm-rotate (lambda () 1)))
437
438 (defun zone-pgm-rotate-RL-lockstep ()
439 (zone-pgm-rotate (lambda () -1)))
440
441 (defun zone-pgm-rotate-LR-variable ()
442 (zone-pgm-rotate (lambda () (1+ (random 3)))))
443
444 (defun zone-pgm-rotate-RL-variable ()
445 (zone-pgm-rotate (lambda () (1- (- (random 3))))))
446
447
448 ;;;; dripping
449
450 (defsubst zone-cpos (pos)
451 (buffer-substring pos (1+ pos)))
452
453 (defsubst zone-replace-char (count del-count char-as-string new-value)
454 (delete-char (or del-count (- count)))
455 (aset char-as-string 0 new-value)
456 (dotimes (i count) (insert char-as-string)))
457
458 (defsubst zone-park/sit-for (pos seconds)
459 (let ((p (point)))
460 (goto-char pos)
461 (prog1 (sit-for seconds)
462 (goto-char p))))
463
464 (defun zone-fret (wbeg pos)
465 (let* ((case-fold-search nil)
466 (c-string (zone-cpos pos))
467 (cw-ceil (ceiling (char-width (aref c-string 0))))
468 (hmm (cond
469 ((string-match "[a-z]" c-string) (upcase c-string))
470 ((string-match "[A-Z]" c-string) (downcase c-string))
471 (t (propertize " " 'display `(space :width ,cw-ceil))))))
472 (do ((i 0 (1+ i))
473 (wait 0.5 (* wait 0.8)))
474 ((= i 20))
475 (goto-char pos)
476 (delete-char 1)
477 (insert (if (= 0 (% i 2)) hmm c-string))
478 (zone-park/sit-for wbeg wait))
479 (delete-char -1) (insert c-string)))
480
481 (defun zone-fill-out-screen (width height)
482 (let ((start (window-start))
483 (line (make-string width 32)))
484 (goto-char start)
485 ;; fill out rectangular ws block
486 (while (progn (end-of-line)
487 (let ((cc (current-column)))
488 (if (< cc width)
489 (insert (substring line cc))
490 (delete-char (- width cc)))
491 (cond ((eobp) (insert "\n") nil)
492 (t (forward-char 1) t)))))
493 ;; pad ws past bottom of screen
494 (let ((nl (- height (count-lines (point-min) (point)))))
495 (when (> nl 0)
496 (setq line (concat line "\n"))
497 (do ((i 0 (1+ i)))
498 ((= i nl))
499 (insert line))))
500 (goto-char start)
501 (recenter 0)
502 (sit-for 0)))
503
504 (defun zone-fall-through-ws (c wbeg wend)
505 (let* ((cw-ceil (ceiling (char-width (aref c 0))))
506 (spaces (make-string cw-ceil 32))
507 (col (current-column))
508 (wait 0.15)
509 newpos fall-p)
510 (while (when (save-excursion
511 (next-line 1)
512 (and (= col (current-column))
513 (setq newpos (point))
514 (string= spaces (buffer-substring-no-properties
515 newpos (+ newpos cw-ceil)))
516 (setq newpos (+ newpos (1- cw-ceil)))))
517 (setq fall-p t)
518 (delete-char 1)
519 (insert spaces)
520 (goto-char newpos)
521 (when (< (point) wend)
522 (delete-char cw-ceil)
523 (insert c)
524 (forward-char -1)
525 (zone-park/sit-for wbeg (setq wait (* wait 0.8))))))
526 fall-p))
527
528 (defun zone-pgm-drip (&optional fret-p pancake-p)
529 (let* ((ww (1- (window-width)))
530 (wh (window-height))
531 (mc 0) ; miss count
532 (total (* ww wh))
533 (fall-p nil)
534 wbeg wend c)
535 (zone-fill-out-screen ww wh)
536 (setq wbeg (window-start)
537 wend (window-end))
538 (catch 'done
539 (while (not (input-pending-p))
540 (setq mc 0 wend (window-end))
541 ;; select non-ws character, but don't miss too much
542 (goto-char (+ wbeg (random (- wend wbeg))))
543 (while (looking-at "[ \n\f]")
544 (if (= total (setq mc (1+ mc)))
545 (throw 'done 'sel)
546 (goto-char (+ wbeg (random (- wend wbeg))))))
547 ;; character animation sequence
548 (let ((p (point)))
549 (when fret-p (zone-fret wbeg p))
550 (goto-char p)
551 (setq c (zone-cpos p)
552 fall-p (zone-fall-through-ws c wbeg wend)))
553 ;; assuming current-column has not changed...
554 (when (and pancake-p
555 fall-p
556 (< (count-lines (point-min) (point))
557 wh))
558 (let ((cw (ceiling (char-width (aref c 0)))))
559 (zone-replace-char cw 1 c ?@) (zone-park/sit-for wbeg 0.137)
560 (zone-replace-char cw nil c ?*) (zone-park/sit-for wbeg 0.137)
561 (zone-replace-char cw nil c ?_)))))))
562
563 (defun zone-pgm-drip-fretfully ()
564 (zone-pgm-drip t))
565
566 (defun zone-pgm-five-oclock-swan-dive ()
567 (zone-pgm-drip nil t))
568
569 (defun zone-pgm-martini-swan-dive ()
570 (zone-pgm-drip t t))
571
572 (defun zone-pgm-rat-race ()
573 (while (not (input-pending-p))
574 (zone-call '((zone-pgm-rotate 10)
575 (zone-pgm-drip-fretfully 15)
576 (zone-pgm-drip 10)
577 ((lambda ()
578 (goto-char (point-min))
579 (while (re-search-forward " +$" nil t)
580 (delete-region (match-beginning 0) (match-end 0))))
581 5)))))
582
583
584 ;;;; paragraph spazzing (for textish modes)
585
586 (defun zone-pgm-paragraph-spaz ()
587 (if (memq (zone-orig major-mode)
588 ;; there should be a better way to distinguish textish modes
589 '(text-mode texinfo-mode fundamental-mode))
590 (let ((fill-column fill-column)
591 (fc-min fill-column)
592 (fc-max fill-column)
593 (max-fc (1- (frame-width))))
594 (while (sit-for 0.1)
595 (fill-paragraph 1)
596 (setq fill-column (+ fill-column (- (random 5) 2)))
597 (when (< fill-column fc-min)
598 (setq fc-min fill-column))
599 (when (> fill-column max-fc)
600 (setq fill-column max-fc))
601 (when (> fill-column fc-max)
602 (setq fc-max fill-column))))
603 (message "Zoning... (zone-pgm-rotate)")
604 (zone-pgm-rotate)))
605
606
607 ;;;; stressing and destressing
608
609 (defun zone-pgm-stress ()
610 (goto-char (point-min))
611 (let (lines)
612 (while (< (point) (point-max))
613 (let ((p (point)))
614 (forward-line 1)
615 (setq lines (cons (buffer-substring p (point)) lines))))
616 (sit-for 5)
617 (zone-hiding-modeline
618 (let ((msg "Zoning... (zone-pgm-stress)"))
619 (while (not (string= msg ""))
620 (message (setq msg (substring msg 1)))
621 (sit-for 0.05)))
622 (while (not (input-pending-p))
623 (when (< 50 (random 100))
624 (goto-char (point-max))
625 (forward-line -1)
626 (let ((kill-whole-line t))
627 (kill-line))
628 (goto-char (point-min))
629 (insert (nth (random (length lines)) lines)))
630 (message (concat (make-string (random (- (frame-width) 5)) ? ) "grrr"))
631 (sit-for 0.1)))))
632
633 (defun zone-pgm-stress-destress ()
634 (zone-call 'zone-pgm-stress 25)
635 (zone-hiding-modeline
636 (sit-for 3)
637 (erase-buffer)
638 (sit-for 3)
639 (insert-buffer-substring "*Messages*")
640 (message "")
641 (goto-char (point-max))
642 (recenter -1)
643 (sit-for 3)
644 (delete-region (point-min) (window-start))
645 (message "hey why stress out anyway?")
646 (zone-call '((zone-pgm-rotate 30)
647 (zone-pgm-whack-chars 10)
648 zone-pgm-drip))))
649
650
651 ;;;; the lyfe so short the craft so long to lerne --chaucer
652
653 (defvar zone-pgm-random-life-wait nil
654 "*Seconds to wait between successive `life' generations.
655 If nil, `zone-pgm-random-life' chooses a value from 0-3 (inclusive).")
656
657 (defun zone-pgm-random-life ()
658 (require 'life)
659 (zone-fill-out-screen (1- (window-width)) (1- (window-height)))
660 (let ((top (progn (goto-char (window-start)) (forward-line 7) (point)))
661 (bot (progn (goto-char (window-end)) (forward-line -7) (point)))
662 (rtc (- (frame-width) 11))
663 (min (window-start))
664 (max (1- (window-end)))
665 s c col)
666 (delete-region max (point-max))
667 (while (and (progn (goto-char min) (sit-for 0.05))
668 (progn (goto-char (+ min (random max)))
669 (or (progn (skip-chars-forward " @\n" max)
670 (not (= max (point))))
671 (unless (or (= 0 (skip-chars-backward " @\n" min))
672 (= min (point)))
673 (forward-char -1)
674 t))))
675 (unless (or (eolp) (eobp))
676 (setq s (zone-cpos (point))
677 c (aref s 0))
678 (zone-replace-char
679 (char-width c)
680 1 s (cond ((or (> top (point))
681 (< bot (point))
682 (or (> 11 (setq col (current-column)))
683 (< rtc col)))
684 32)
685 ((and (<= ?a c) (>= ?z c)) (+ c (- ?A ?a)))
686 ((and (<= ?A c) (>= ?Z c)) ?*)
687 (t ?@)))))
688 (sit-for 3)
689 (setq col nil)
690 (goto-char bot)
691 (while (< top (point))
692 (setq c (point))
693 (move-to-column 9)
694 (setq col (cons (buffer-substring (point) c) col))
695 (end-of-line 0)
696 (forward-char -10))
697 (let ((life-patterns (vector
698 (if (and col (search-forward "@" max t))
699 (cons (make-string (length (car col)) 32) col)
700 (list (mapconcat 'identity
701 (make-list (/ (- rtc 11) 15)
702 (make-string 5 ?@))
703 (make-string 10 32)))))))
704 (life (or zone-pgm-random-life-wait (random 4)))
705 (kill-buffer nil))))
706
707 (random t)
708
709 ;;;;;;;;;;;;;;;
710 (provide 'zone)
711
712 ;;; arch-tag: 7092503d-74a9-4325-a55c-a026ede58cea
713 ;;; zone.el ends here