;;; life.el --- John Horton Conway's `Life' game for GNU Emacs
-;; Copyright (C) 1988 Free Software Foundation, Inc.
+;; Copyright (C) 1988, 2001 Free Software Foundation, Inc.
-;; Author: Kyle Jones <talos!kjones@uunet.uu.net>
+;; Author: Kyle Jones <kyleuunet.uu.net>
;; Keywords: games
;; This file is part of GNU Emacs.
" @@ " " @@ " " @@ "
" @@ " " @@ " " @@ "
" @@")
- ("@@@@@@@@@" "@ @ @" "@ @@@@@ @" "@ @ @ @" "@@@ @@@"
+ ("@@@@@@@@@" "@ @ @" "@ @@@@@ @" "@ @ @ @" "@@@ @@@"
"@ @ @ @" "@ @@@@@ @" "@ @ @" "@@@@@@@@@")]
"Vector of rectangles containing some Life startup patterns.")
(setq life-initialized t)
(or sleeptime (setq sleeptime 1))
(life-setup)
- (life-display-generation sleeptime)
(catch 'life-exit
(while t
(let ((inhibit-quit t))
+ (life-display-generation sleeptime)
(life-grim-reaper)
(life-expand-plane-if-needed)
- (life-increment-generation)
- (life-display-generation sleeptime)))))
+ (life-increment-generation)))))
(defalias 'life-mode 'life)
(put 'life-mode 'mode-class 'special)
(defun life-grim-reaper ()
;; Clear the match information. Later we check to see if it
;; is still clear, if so then all the cells have died.
- (store-match-data nil)
+ (set-match-data nil)
(goto-char (point-min))
;; For speed declare all local variable outside the loop.
(let (point char pivot living-neighbors list)
(defun life-display-generation (sleeptime)
(goto-char life-window-start)
(recenter 0)
-
+
;; Redisplay; if the user has hit a key, exit the loop.
(or (eq t (sit-for sleeptime))
(throw 'life-exit nil)))