Re: Random seed.
Re: Random seed.
- Subject: Re: Random seed.
- From: Daniel Robinson <email@hidden>
- Date: Thu, 21 Jun 2001 18:34:07 -0400
Here you go.
---
Set TheSeed to 5 -- or whatever
random number TheSeed -- this will give you a whole number from zero to
TheSeed
---
Here's a random number test script I wrote a couple months ago when we had a
discussion on this list.
you'll see that the distribution is correct
--Dan
------------------------------------------------------------------------
set TheList to {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
set N to the count of items in TheList
repeat 100000 times
random number N - 1 -- (I get it back on the next line)
set ThisNumber to the result + 1 -- (Don't want a zero)
set item ThisNumber of TheList to (item ThisNumber of TheList) + 1
end repeat
TheList
------------------------------------------------------------------------
"Fox, Christopher B" wrote:
>
What is the default seed for the Random number command in the Standard
>
Additions OSAX? Just how "random" are the numbers generated with this
>
routine?
>
>
Christopher Fox
>
>
>
**************************************************************************
>
The Information transmitted herewith is sensitive information intended only
>
for use to the individual or entity to which it is addressed. If the reader
>
of this message is not the intended recipient, you are hereby notified that
>
any review, retransmission, dissemination, distribution, copying or other
>
use of, or taking of any action in reliance upon, this information is
>
strictly prohibited. If you have received this communication in error,
>
please contact the sender and delete the material from your computer.
>
_______________________________________________
>
applescript-users mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
References: | |
| >Random seed. (From: "Fox, Christopher B" <email@hidden>) |