Re: A86: Re: Creating distinct random-integer lists using ASM or BASIC


[Prev][Next][Index][Thread]

Re: A86: Re: Creating distinct random-integer lists using ASM or BASIC






>To: assembly-86@lists.ticalc.org
>Date: Sat, 3 Oct 1998 05:56:07 -0700
>Subject: A86: Re: Creating distinct random-integer lists using ASM or 
BASIC
>From: rabidcow@juno.com (Joshua J Seagoe)
>Reply-To: assembly-86@lists.ticalc.org
>
>
>
>On Fri, 2 Oct 1998 19:50:29 -0400 "Dux Gregis" 
<assets@eden.rutgers.edu>
>writes:
>>
>>
>>In basic you can use rand to get a number between one and 10, scan 
>>through
>>the list and if your integer is there already, rerandomize the int and 
>>scan
>>again.
>
>no!  you fill a list with all the numbers in the range and shuffle!
>say you want 1-10, you fill the list with
>{1 2 3 4 5 6 7 8 9 10}
>then you pick two places at random, say 3 and 8, and swap them
>{1 2 8 4 5 6 7 3 9 10}
>then you repeat this several times.
>
>
>-josh

This would actually be slower. Not to mention is you say shuffled it 10 
times with random places some #'s would stay in their original spot. The 
routine I posted is faster and is better with randomizing. U people can 
stop posting now. He has his routine.

-InFuZeD " The Basic Guru "

p.s.: Anyone needing Basic help can email me personally at 
zone_ti@hotmail.com

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


Follow-Ups: