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






>From: "Dux Gregis" <assets@eden.rutgers.edu>
>To: <assembly-86@lists.ticalc.org>
>Subject: A86: Re: Creating distinct random-integer lists using ASM or 
BASIC
>Date: Fri, 2 Oct 1998 19:50:29 -0400
>Reply-To: assembly-86@lists.ticalc.org
>
>
>
>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.
>

That is very slow =( I've tried this in basic as well with a program 
that randomly places #'s in one of four spots. Even that was really 
slow. It would be alot harder in asm. In basic you'd have to try this.

;For a list of 10 #'s randomly placed in a list
:10 -> dimL List
:Fill(0,List
:For(A,1,10
:Lbl A
:randInt(1,10)->C
:If List(C)(is not equal to)0:Goto A
:A->List(C)
:End

I'm pretty sure this will work. It is probably the fastest possible in 
Basic.

-InFuZeD " The Basic Guru "

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