1 |
;;; life.el --- John Horton Conway's `Life' game for GNU Emacs |
;;; life.el --- John Horton Conway's `Life' game for GNU Emacs |
2 |
|
|
3 |
;; Copyright (C) 1988, 2001 Free Software Foundation, Inc. |
;; Copyright (C) 1988, 2001, 2004 Free Software Foundation, Inc. |
4 |
|
|
5 |
;; Author: Kyle Jones <kyleuunet.uu.net> |
;; Author: Kyle Jones <kyleuunet.uu.net> |
6 |
|
;; Maintainer: FSF |
7 |
;; Keywords: games |
;; Keywords: games |
8 |
|
|
9 |
;; This file is part of GNU Emacs. |
;; This file is part of GNU Emacs. |
31 |
|
|
32 |
;;; Code: |
;;; Code: |
33 |
|
|
34 |
(defconst life-patterns |
(defvar life-patterns |
35 |
[("@@@" " @@" "@@@") |
[("@@@" " @@" "@@@") |
36 |
("@@@ @@@" "@@ @@ " "@@@ @@@") |
("@@@ @@@" "@@ @@ " "@@@ @@@") |
37 |
("@@@ @@@" "@@ @@" "@@@ @@@") |
("@@@ @@@" "@@ @@" "@@@ @@@") |
81 |
|
|
82 |
;; list of numbers that tell how many characters to move to get to |
;; list of numbers that tell how many characters to move to get to |
83 |
;; each of a cell's eight neighbors. |
;; each of a cell's eight neighbors. |
84 |
(defconst life-neighbor-deltas nil) |
(defvar life-neighbor-deltas nil) |
85 |
|
|
86 |
;; window display always starts here. Easier to deal with than |
;; window display always starts here. Easier to deal with than |
87 |
;; (scroll-up) and (scroll-down) when trying to center the display. |
;; (scroll-up) and (scroll-down) when trying to center the display. |
88 |
(defconst life-window-start nil) |
(defvar life-window-start nil) |
89 |
|
|
90 |
;; For mode line |
;; For mode line |
91 |
(defconst life-current-generation nil) |
(defvar life-current-generation nil) |
92 |
;; Sadly, mode-line-format won't display numbers. |
;; Sadly, mode-line-format won't display numbers. |
93 |
(defconst life-generation-string nil) |
(defvar life-generation-string nil) |
94 |
|
|
95 |
(defvar life-initialized nil |
(defvar life-initialized nil |
96 |
"Non-nil if `life' has been run at least once.") |
"Non-nil if `life' has been run at least once.") |