Random #'s

James Hurley jhurley at infostations.com
Thu Jan 27 19:02:00 CST 2005


>
>Message: 17
>Date: Thu, 27 Jan 2005 15:21:09 -0700
>From: Dar Scott <dsc at swcp.com>
>Subject: Re: Random #'s
>To: How to use Revolution <use-revolution at lists.runrev.com>
>Message-ID: <BED5B8C6-70B1-11D9-BE1B-000A9567A3E6 at swcp.com>
>Content-Type: text/plain; charset=US-ASCII; format=flowed
>
>
>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(10000)
>    return item 1 to 6 of x
>end rlist
>
>Dar

I confess, I never understood this.

And I can't imagine how Dwayne will choose among the multitude of 
solutions proposed. Maybe:

put "all solutions" into x
sort items of "all ten solutions" by random(10000)
return item 1 of x


Jim


More information about the use-livecode mailing list