comparison lisp/play/life.el @ 58252:a22adc2b72fb

Maintainer is now FSF. (life-patterns, life-neighbor-deltas, life-window-start) (life-current-generation, life-generation-string): Use defvar instead of defconst.
author Luc Teirlinck <teirllm@auburn.edu>
date Tue, 16 Nov 2004 02:54:06 +0000
parents 695cf19ef79e
children eaa9acd9122c b637c617432f
comparison
equal deleted inserted replaced
58251:11be17ba7a64 58252:a22adc2b72fb
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, 2001 Free Software Foundation, Inc. 3 ;; Copyright (C) 1988, 2001, 2004 Free Software Foundation, Inc.
4 4
5 ;; Author: Kyle Jones <kyleuunet.uu.net> 5 ;; Author: Kyle Jones <kyleuunet.uu.net>
6 ;; Maintainer: FSF
6 ;; Keywords: games 7 ;; Keywords: games
7 8
8 ;; This file is part of GNU Emacs. 9 ;; This file is part of GNU Emacs.
9 10
10 ;; GNU Emacs is free software; you can redistribute it and/or modify 11 ;; GNU Emacs is free software; you can redistribute it and/or modify
28 ;; in Emacs Lisp. Picks a random one of a set of interesting Life 29 ;; in Emacs Lisp. Picks a random one of a set of interesting Life
29 ;; patterns and evolves it according to the familiar rules. 30 ;; patterns and evolves it according to the familiar rules.
30 31
31 ;;; Code: 32 ;;; Code:
32 33
33 (defconst life-patterns 34 (defvar life-patterns
34 [("@@@" " @@" "@@@") 35 [("@@@" " @@" "@@@")
35 ("@@@ @@@" "@@ @@ " "@@@ @@@") 36 ("@@@ @@@" "@@ @@ " "@@@ @@@")
36 ("@@@ @@@" "@@ @@" "@@@ @@@") 37 ("@@@ @@@" "@@ @@" "@@@ @@@")
37 ("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@") 38 ("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@")
38 ("@@@@@@@@@@") 39 ("@@@@@@@@@@")
78 (defmacro life-increment (variable) (list 'setq variable (list '1+ variable))) 79 (defmacro life-increment (variable) (list 'setq variable (list '1+ variable)))
79 80
80 81
81 ;; list of numbers that tell how many characters to move to get to 82 ;; list of numbers that tell how many characters to move to get to
82 ;; each of a cell's eight neighbors. 83 ;; each of a cell's eight neighbors.
83 (defconst life-neighbor-deltas nil) 84 (defvar life-neighbor-deltas nil)
84 85
85 ;; window display always starts here. Easier to deal with than 86 ;; window display always starts here. Easier to deal with than
86 ;; (scroll-up) and (scroll-down) when trying to center the display. 87 ;; (scroll-up) and (scroll-down) when trying to center the display.
87 (defconst life-window-start nil) 88 (defvar life-window-start nil)
88 89
89 ;; For mode line 90 ;; For mode line
90 (defconst life-current-generation nil) 91 (defvar life-current-generation nil)
91 ;; Sadly, mode-line-format won't display numbers. 92 ;; Sadly, mode-line-format won't display numbers.
92 (defconst life-generation-string nil) 93 (defvar life-generation-string nil)
93 94
94 (defvar life-initialized nil 95 (defvar life-initialized nil
95 "Non-nil if `life' has been run at least once.") 96 "Non-nil if `life' has been run at least once.")
96 97
97 ;;;###autoload 98 ;;;###autoload