Re: Random #'s

2005-01-28 Thread Rob Cozens
Hi Dwane, I am using the following code to generate a field of 6 random numbers. repeat 5 times --generate list of 5 random numbers between 1-10 put random(10) , after tRnum end repeat delete last char of tRnum --delete last comma put tRnum into fld numbers this works fine but some

Re: Random #s

2005-01-28 Thread Michael D Mays
If you are asking the random of a big number then that will be true. I think I remember that to generate a list of random numbers what you should be doing is asking questions like random(N) random(N-1) . . . 1 If you wanted to generate a random list with the numbers 1 thru 10 random(10) - 3 Now

Re: Random #'s

2005-01-28 Thread Michael D Mays
What does it mean to sort 1,2,3,4,5 by 12? Maybe it should be sort items of x numeric by random(1) ? Michael On Jan 27, 2005, at 4:21 PM, Dar Scott wrote: On Jan 27, 2005, at 2:31 AM, D.Rothe wrote: How can I include only unique numbers? Here is an interesting variation: on mouseUp put

Re: Random #'s

2005-01-28 Thread Dar Scott
On Jan 28, 2005, at 11:08 AM, Michael D Mays wrote: What does it mean to sort 1,2,3,4,5 by 12? Maybe it should be sort items of x numeric by random(1) Yes! Sorry about that. I think sort by 12 effectively means to associate 12 with each item and then sort by the associated value. The

Re: Random #'s

2005-01-28 Thread Dwayne Rothe
Hey Guys after analysing the multitude of responses I finally went with the shortest code! It works perfect fast, thats all I needed repeat until the number of items in tRnum = 5 set randomSeed to random(1) put random(10) into tRand if tRand is not among the items of tRnum then put

Random #'s

2005-01-27 Thread D.Rothe
Hi All, I am using the following code to generate a field of 6 random numbers. repeat 5 times --generate list of 5 random numbers between 1-10 put random(10) , after tRnum end repeat delete last char of tRnum --delete last comma put tRnum into fld numbers this works fine but some numbers are

Re: Random #'s

2005-01-27 Thread Nicolas Cueto
Here's one way to do it, with a button-script: (B (Bon mouseUp (B repeat (Bif the number of lines in tResult 5 then exit repeat (Bput random(10) into tRand (Bif tRand is not among the lines of tResult then (B put tRand cr after tResult (Bend if (B end repeat (B

Re: Random #s

2005-01-27 Thread Mark Smith
How about something like: repeat until the number of items in tRnum = 5 put random(10) into tRand if tRand is not among the items of tRnum then put tRand comma after tRnum end repeat Cheers, Mark On 27 Jan 2005, at 10:34, [EMAIL PROTECTED] wrote: repeat 5 times --generate list of 5 random

Re: Random #'s

2005-01-27 Thread Raymond E. Griffith
Hi All, I am using the following code to generate a field of 6 random numbers. repeat 5 times --generate list of 5 random numbers between 1-10 put random(10) , after tRnum end repeat delete last char of tRnum --delete last comma put tRnum into fld numbers this works fine but some

Re: Random #s

2005-01-27 Thread Dave Cragg
On 27 Jan 2005, at 11:25, Mark Smith wrote: How about something like: repeat until the number of items in tRnum = 5 put random(10) into tRand if tRand is not among the items of tRnum then put tRand comma after tRnum end repeat Although I'm sure this is fine in practice, this kind of solution

Re: Random #'s

2005-01-27 Thread Éric Chatonet
Hi Dwayne, put GenerateRandom(6,10) -- the right parameters in your case function GenerateRandom pHowMuchNumbers,pRange local tRangeList - repeat until the number of lines of tRangeList = pHowMuchNumbers set the randomSeed to random(10) put random(pRange) into pNum if

Re: Random #'s

2005-01-27 Thread Dan Friedman
Dwayne, I'm sure there's a better way to do it, but how about this... function makeRandomNumberList maxNumber put 0 into i repeat put random(10) into thisNum if thisNum is among the items of fNumbers then next repeat end if add 1 to i put thisNum into item i of

Re: Random #'s

2005-01-27 Thread Dar Scott
On Jan 27, 2005, at 2:31 AM, D.Rothe wrote: How can I include only unique numbers? Here is an interesting variation: on mouseUp put rlist() end mouseUp function rlist put 1,2,3,4,5,6,7,8,9,10 into x sort items of x by random(1) return item 1 to 6 of x end rlist Dar

Re: Random #'s

2005-01-27 Thread James Hurley
Message: 17 Date: Thu, 27 Jan 2005 15:21:09 -0700 From: Dar Scott [EMAIL PROTECTED] Subject: Re: Random #'s To: How to use Revolution use-revolution@lists.runrev.com Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=US-ASCII; format=flowed On Jan 27, 2005, at 2:31 AM, D.Rothe wrote