Board index » delphi » Memory Address(es) of RANDOMS

Memory Address(es) of RANDOMS

Hallo all

I was wondering if anyone knew where the Random integers are stored, if at
all, in RAM. Is there anyone particular 16-bit register or physical address
where this occurs and if so how can one access it.

Should it make a difference if it is protected or not, bearing in mind we
can access the content of the various registers?

I actually want to take the 100th generated Random Number (Range 0-1000) and
using Graph.TPU make it LARGE, colored etc.

Any advice will be appreciated!

 

Re:Memory Address(es) of RANDOMS


Quote
Lawrence Breakey wrote:
> Hallo all

> I was wondering if anyone knew where the Random integers are stored, if at
> all, in RAM. Is there anyone particular 16-bit register or physical address
> where this occurs and if so how can one access it.

They're not stored anywhere -- especially when you consider that since the
random number generator uses a longint base and has a periodicity of 2^32 (at
least this value holds true for TP7), it would take 16GB to store all the seed
values.  Random numbers are generated by an equation, based around the value
of the longint variable System.RandSeed.

Quote
> Should it make a difference if it is protected or not, bearing in mind we
> can access the content of the various registers?

Irrelevant.

Quote
> I actually want to take the 100th generated Random Number (Range 0-1000) and
> using Graph.TPU make it LARGE, colored etc.

Seed the generator, generate 100 random numbers in the range you want, save
the 100th value and use that for whatever your purposes.

Quote
> Any advice will be appreciated!

--
Scott Earnest            | SPAM protection in effect. Remove  |
setech@_ix.netcom.com    | "_" as needed for true addresses.  |
earnests@_homenet.lm.com |    UIN:1136443  EFnet:pale_blue    |
sinykal@_{*word*104}space.org  | URL: http://www.netcom.com/~setech |

Re:Memory Address(es) of RANDOMS


Quote
Lawrence Breakey (lbrea...@ilink.nis.za) wrote:

: I was wondering if anyone knew where the Random integers are stored, if at
: all, in RAM. Is there anyone particular 16-bit register or physical address
: where this occurs and if so how can one access it.

       Why don't you let the computer give it to you,
just do the random equal thing 99 times, and the next
one is the one you want. :-)

: I actually want to take the 100th generated Random Number (Range 0-1000) and
: using Graph.TPU make it LARGE, colored etc.

       Don't you want a different number each time? ;-)
If you do a random equal thing in a repeat until keypressed
loop before the routine where you get the random number
it will have the effect of seeding, which can be a
problem if you want a low range random number.

Ken Fischer

---

Re:Memory Address(es) of RANDOMS


Quote
Scott Earnest wrote:

> Lawrence Breakey wrote:

>  Hallo all

>  I was wondering if anyone knew where the Random integers are stored, if at
>  all, in RAM. Is there anyone particular 16-bit register or physical address
>  where this occurs and if so how can one access it.

i don't know about the speed of the randomgenerator, but it seems to me
it's slow and to good maybe, You can try to handcraft your
randomgenerator, or rip it from my program shower2d.pas from the file
package.zip at http://members.tripod.com/~Hatsjoe/pascal.zip

Hatsjoe

Other Threads