From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: numerical analysis
Date: Fri, 30 Jul 2004 11:05:10 -0600 [thread overview]
Message-ID: <410A7FC6.9000808@yahoo.com> (raw)
In-Reply-To: 10gjdus6ip76h85@corp.supernews.com
Edward Casey wrote:
> This code fragment produces somewhat pseudo-random powerball numbers:
>
> (progn
> (random t)
> (setq lis6 nil)
> (while (< (length lis6) 5)
> ;; (setq cm (+ (mod (* (nth 1 (current-time))(/ (nth 2
> (current-time)) 10000)(random)) 52) 1))
> ;; (random t)
> (setq cm (+ (random 52) 1))
> (if (not (member cm lis6)) (setq lis6 (cons cm lis6)))
> )
> (setq lis6 (sort lis6 '>))
> (random t)
> (setq cm (+ (random 41) 1))
> (setq lis6 (cons cm lis6))
> (reverse lis6)
> )
>
> The commented-out lines don't seem to work in a loop. Is there some
> way I could mix this up some more to get closer to true randomness?
Why do you (re)set the random number seed more than once?
In what way does the (setq cm ...) form not work?
> In emacs lisp is it possible to open an arbitrary file (say a
> compressed graphic file of white noise) and to advance the file
> pointer by 8-bit increments?
Use find-file-literally or insert-file-contents-literally, then forward-char.
--
Kevin Rodgers
next prev parent reply other threads:[~2004-07-30 17:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-30 2:52 numerical analysis Edward Casey
2004-07-30 17:05 ` Kevin Rodgers [this message]
2004-07-31 4:31 ` Edward Casey
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=410A7FC6.9000808@yahoo.com \
--to=ihs_4664@yahoo.com \
/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.