(provide (quote life)) (defconst life-patterns [("@@@" " @@" "@@@") ("@@@ @@@" "@@ @@ " "@@@ @@@") ("@@@ @@@" "@@ @@" "@@@ @@@") ("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@") ("@@@@@@@@@@") (" @@@@@@@@@@ " " @@@@@@@@@@ " " @@@@@@@@@@ " "@@@@@@@@@@ " "@@@@@@@@@@ ") ("@" "@" "@" "@" "@" "@" "@" "@" "@" "@" "@" "@" "@" "@" "@") ("@ @" "@ @" "@ @" "@ @" "@ @" "@ @" "@ @" "@ @" "@ @" "@ @" "@ @" "@ @" "@ @" "@ @" "@ @") ("@@ " " @@ " " @@ " " @@ " " @@ " " @@ " " @@ " " @@ " " @@ " " @@ " " @@ " " @@ " " @@ " " @@ " " @@ " " @@") ("@@@@@@@@@" "@ @ @" "@ @@@@@ @" "@ @ @ @" "@@@ @@@" "@ @ @ @" "@ @@@@@ @" "@ @ @" "@@@@@@@@@")] "\ Vector of rectangles containing some Life startup patterns.") (require (progn (defmacro life-life-char nil 64) (defmacro life-death-char nil (1+ (life-life-char))) (defmacro life-birth-char nil 3) (defmacro life-void-char nil 32) (defmacro life-life-string nil (char-to-string (life-life-char))) (defmacro life-death-string nil (char-to-string (life-death-char))) (defmacro life-birth-string nil (char-to-string (life-birth-char))) (defmacro life-void-string nil (char-to-string (life-void-char))) (defmacro life-not-void-regexp nil (concat "[^" (life-void-string) " ]")) (defmacro goto-beginning-of-buffer nil (quote (goto-char 1))) (defmacro maxint nil (lsh (lsh (lognot 0) 1) -1)) (defmacro goto-end-of-buffer nil (quote (goto-char (maxint)))) (defmacro increment (variable) (list (quote setq) variable (list (quote 1+) variable))) (quote life))) (defconst life-neighbor-deltas nil) (defconst life-window-start nil) (defconst life-current-generation nil) (defconst life-generation-string nil) (defun abs (n) (byte-code "AWf (defun life (&optional sleeptime) "\ Run Conway's Life simulation. The starting pattern is randomly selected. Prefix arg (optional first arg non-nil from a program) is the number of seconds to sleep between generations (this defaults to 1)." (interactive "p") (byte-code "E+ (fset (quote life-mode) (quote life)) (put (quote life-mode) (quote mode-class) (quote special)) (random t) (defun life-setup nil (byte-code "AIII!A\"^I ^D ^ANOAOOO O S ? ^Op!^U ^*b^UUAA#.F SB ^`)Za\"%^m?.g j^a !^c`B ^`\"^a ^,+ ]" replace-match "@" / end-of-line 2 forward-line window-height count-lines newline 8388607 move-to-column delete-region untabify life-expand-plane-if-needed life-compute-neighbor-deltas] 26)) (defun life-compute-neighbor-deltas nil (byte-code "AA [ T[A \\[A TA \\&%+" [life-neighbor-deltas fill-column list -1 2 1] 10)) (defun life-insert-random-pattern nil (byte-code "AAAAA !G\"\"!^Ac+" [life-patterns insert-rectangle elt % abs random 10] 8)) (defun life-increment-generation nil (byte-code "T%^A!%+" [life-current-generation life-generation-string int-to-string] 3)) (defun life-grim-reaper nil (byte-code "EA!^Eb^AAAAAEEAA#.? I=fB IWfT TA%,o DWfe DA%,o NY.o (defun life-expand-plane-if-needed nil (byte-code "A?^Ab^ACE`E$A#.. A#%^Ib^ICI`E$A#.Y A#%+" [fill-column t life-window-start done (byte-code "Ab^m?.G (defun life-display-generation (sleeptime) (byte-code "b^AA!^A !+" [life-window-start sleeptime recenter 0 sit-for] 3)) (defun life-extinct-quit nil (byte-code "AA!^AAA\"+" [nil life-display-generation 0 signal life-extinct] 4)) (put (quote life-extinct) (quote error-conditions) (quote (life-extinct quit))) (put (quote life-extinct) (quote error-message) "All life has perished") .