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




-----Original Message-----
From: QmH@aol.com <QmH@aol.com>
To: assembly-86@lists.ticalc.org <assembly-86@lists.ticalc.org>
Date: Friday, October 02, 1998 8:37 PM
Subject: Re: A86: Re: Creating distinct random-integer lists using ASM or
BASIC


>
>In a message dated 98-10-02 19:50:06 EDT, you write:
>
><< 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. >>
>
>yea... but how would you scan through the list without it taking a long
time?
>lets say you had a 50 item list... it would take a very long time.
>

Yes, it would take a while.  You could make an ASM sub-program to get info
from the list and compare it to certain varibles that contained the new
random integer.  Then the ASM prog gets the next byte and compares it to the
variable and the max. number could be put in bc and "djnz" used to go
through the loop however many places needed to be checked.  Or instead of
the maximum, just the number of times that a new random integer has been
retrieved.  Dux has a nice tutorial on absolute addressing and the "rst $20"
and "rst $10" opcodes.
Hope this helps,
--------------
Jbrett
tbarwick@esn.net
http://ww2.esn.net/~tbarwick
I just added a TI-86 page, Check it out!!!