Mercurial > emacs
comparison lisp/play/life.el @ 36750:83e8e419d94d
(life): Rearrange code so that all calls to
life-display-generation are in a catch-form.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Mon, 12 Mar 2001 16:44:56 +0000 |
parents | acffd9b0ac6d |
children | 0d8b17d428b5 |
comparison
equal
deleted
inserted
replaced
36749:ed71c7411538 | 36750:83e8e419d94d |
---|---|
1 ;;; life.el --- John Horton Conway's `Life' game for GNU Emacs | 1 ;;; life.el --- John Horton Conway's `Life' game for GNU Emacs |
2 | 2 |
3 ;; Copyright (C) 1988 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1988, 2001 Free Software Foundation, Inc. |
4 | 4 |
5 ;; Author: Kyle Jones <kyleuunet.uu.net> | 5 ;; Author: Kyle Jones <kyleuunet.uu.net> |
6 ;; Keywords: games | 6 ;; Keywords: games |
7 | 7 |
8 ;; This file is part of GNU Emacs. | 8 ;; This file is part of GNU Emacs. |
104 (or life-initialized | 104 (or life-initialized |
105 (random t)) | 105 (random t)) |
106 (setq life-initialized t) | 106 (setq life-initialized t) |
107 (or sleeptime (setq sleeptime 1)) | 107 (or sleeptime (setq sleeptime 1)) |
108 (life-setup) | 108 (life-setup) |
109 (life-display-generation sleeptime) | |
110 (catch 'life-exit | 109 (catch 'life-exit |
111 (while t | 110 (while t |
112 (let ((inhibit-quit t)) | 111 (let ((inhibit-quit t)) |
112 (life-display-generation sleeptime) | |
113 (life-grim-reaper) | 113 (life-grim-reaper) |
114 (life-expand-plane-if-needed) | 114 (life-expand-plane-if-needed) |
115 (life-increment-generation) | 115 (life-increment-generation))))) |
116 (life-display-generation sleeptime))))) | |
117 | 116 |
118 (defalias 'life-mode 'life) | 117 (defalias 'life-mode 'life) |
119 (put 'life-mode 'mode-class 'special) | 118 (put 'life-mode 'mode-class 'special) |
120 | 119 |
121 (defun life-setup () | 120 (defun life-setup () |