Re: A86: Re: question


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

Re: A86: Re: question




a nice way to get random numbers that ppl can't tamper with, and that doesn't
require the OP registers is the 'r' register (which i believe is what ztetris,
or at least one of the zshell versions, if not jimmy mardell's, uses)...
something like this is good:
 ld a,r
 shr a

the shr a is necessary b/c the r register increases by 2 each clock cycle, so
the right bit is always the same.  now a is a 7 bit random #...  if you need
less bits, then shift it right some more...  also, you can't really use that
method again until you do something that requires some sort of user input
because it will always be so much above the original, anyway, i'm babbling, so
i'll stop now...  hope this helps.

Trey Jazz wrote:

> o yeah...i think most ppl use _RANDOM but others might get a value off the
> bus
>
> -----Original Message-----
> From: Scalp <scalp@bigfoot.com>
> To: assembly-86@lists.ticalc.org <assembly-86@lists.ticalc.org>
> Date: Saturday, March 07, 1998 10:43 AM
> Subject: A86: question
>
> >
> >I all your prog, what do you use to get a Random number ???
> >it's not always _RANDOM i think, because if it was that, making "0->rand"
> >in basic before playing ZTetris will give you always the same game...
> >
> >I wan't to make a prog that shutdown the calc, and each time you turn it
> >on, make some code and shut down again, can someone help me ??? (i got a
> >source "StartOn", but it doesn't seem to work)
> >
> >Thanx
> >



--
Stephen Hicks
mailto:shicks@mindspring.com
UIN:5453914
AIM:Kupopo1



Follow-Ups: References: