all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thien-Thi Nguyen <ttn@glug.org>
Subject: Re: defconst in life.el
Date: 14 Nov 2004 17:32:44 -0500	[thread overview]
Message-ID: <jkwtwo83jn.fsf@glug.org> (raw)
In-Reply-To: Luc Teirlinck's message of "Sun, 14 Nov 2004 15:39:09 -0600 (CST)"

Luc Teirlinck <teirllm@dms.auburn.edu> writes:

   Maybe somebody who uses life.el could give a more definitive answer.

the docstring gives a hint: "some".  this var is meant to be used
experimentally (value modified, augmented, etc), so defvar is more
suitable than defconst.

e.g.:
(defun random-life () (interactive)
  (let* ((w (+ 10 (random (- (frame-width) 10))))
         (h (+ 5 (random (- (frame-height) 5))))
         ;; a pleasant propensity to delightful density
         (n (random (round (/ (* w h) 2))))
         (r (mapcar (lambda (x) (make-string w 32))
                    (number-sequence 1 h))))
    (while (< 0 n)
      (aset (nth (random h) r) (random w) ?@)
      (setq n (1- n)))
    (let ((life-patterns (vector r)))
      (life 0))))

thi

  parent reply	other threads:[~2004-11-14 22:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-14 18:40 defconst in life.el Luc Teirlinck
2004-11-14 21:02 ` Stefan Monnier
2004-11-14 21:39   ` Luc Teirlinck
2004-11-14 21:42     ` Luc Teirlinck
2004-11-14 22:32     ` Thien-Thi Nguyen [this message]
2004-11-14 22:51       ` Luc Teirlinck
2004-11-17  1:48         ` Kenichi Handa
2004-11-23  2:34           ` Luc Teirlinck
2004-11-19 17:52       ` Juri Linkov
2004-11-19 18:47         ` Thien-Thi Nguyen
2004-11-15 14:00 ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jkwtwo83jn.fsf@glug.org \
    --to=ttn@glug.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.