Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site bu-cs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!bu-cs!root From: root@bu-cs.UUCP (Barry Shein) Newsgroups: net.emacs Subject: Critical GNU emacs prog! Message-ID: <697@bu-cs.UUCP> Date: Sat, 5-Oct-85 21:32:54 EDT Article-I.D.: bu-cs.697 Posted: Sat Oct 5 21:32:54 1985 Date-Received: Mon, 7-Oct-85 02:52:53 EDT Organization: Boston Univ Comp. Sci. Lines: 43 Ok people, like, I'm *real* busy these days, but fortunately I found the time to write this thing cuz I know you couldn't live another day without it.... -Barry Shein, Boston University -------fold and cut here-------------- ;;; ;;; Canonical GNU copyright conditions apply ;;; TWINKLE (c) Barry Shein 1985 ;;; Though I admit it's not very original ;;; (defun twinkle () "TWINKLE creates and displays a twinkling buffer typing any char stops and returns to previous buffer" (interactive) (let* ((curbuf (current-buffer)) (newbuf (get-buffer-create "*Twinkle*")) (height (1- (window-height))) (width (1- (screen-width))) (i 0) (init-string (make-string width 32)) ;;; that is, a line of blanks (mask 255)) ;;; random can return negative (switch-to-buffer newbuf) (delete-other-windows) (erase-buffer) (while (< i height) ;;; fill window w/ blanks (princ init-string newbuf) (princ "\n" newbuf) (setq i (1+ i))) ;;; try for a little giggle (message "Twinkle Twinkle little star... [hit space to stop]") (while (not (input-pending-p)) ;;; randomly (un)display *'s (goto-char 1) (forward-char (% (logand (random) mask) width)) (next-line (% (logand (random) mask) height)) (delete-char (if (bolp) 1 -1)) (if (zerop (logand (random) 1)) (princ "*" newbuf) (princ " " newbuf))(sit-for 0)) (read-char) ;;; swallow up stop char (switch-to-buffer curbuf) (message ;;; try for guilt "You'll sit and watch this idiocy but you won't sing along, sigh...")))