|
|
> Thanks for the fast reply. Is the value plugged into the rand() statement
> actually a subscript to a value in the random number stream? If yes, then
> how long is the random number stream (how many times can I tap into the
same
> stream)? TIA, again...gjw
Think of colorSeed as a list of random numbers, and rand(colorSeed) always
gets the next one. If you want to start over, you just #declare colorSeed
again in the same way. My guess is that the stream is about 2^32 numbers
long, which is long enough that you'll never hit the end of it (and if you
do it will just loop back to the beginning).
The only reason to have the "seed" in the first place is so that you can
have different streams of random numbers. So if you write code that
generates 100 random colors, and you like the randomness you're getting, but
in the same loop you want to generate 100 random positions, you can use a
different seed (like positionSeed or something) and it won't change the
colors that are generated.
- Slime
[ http://www.slimeland.com/ ]
Post a reply to this message
|
|