If Random() always uses the same seed then this additional parameter for RandomSeed() would be nice.Note: each times a program start, a new seed is generated ..
RandomSeed with Maximum parameter
RandomSeed with Maximum parameter
RandomSeed(Value[, Maximum])
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
RandomSeed() ensures that you always get the same numbers, even when you restart your program.
On first program start, you get the numberson second start, you get the numbersand so on. The third start gives you the same numbers again. A maximum parameter for RandomSeed() is nonsense, you can use the maximum parameter provided by Random(). This parameter is independent from RandomSeed().
Btw, Random() returns a long.
On first program start, you get the numbers
Code: Select all
1 57 34 296 346 ...
Code: Select all
1 57 34 296 346 ...
Btw, Random() returns a long.
PB 4.30
Code: Select all
onErrorGoto(?Fred)
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
the Seed is independent from the Range of the later called Random function.
this code:
always produces
... wonder if it returns the same as a 64bit exe.
this code:
Code: Select all
RandomSeed( 42 )
Debug Random( 4711 )
Debug Random( 4711 )
Debug Random( 10 )
Debug Random( 4711 )
and so it always should as a 32bit exe.866
2197
4
2483
... wonder if it returns the same as a 64bit exe.
oh... and have a nice day.
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
Sorry, Sir. I seemingly messed it up.Demivec wrote:Actually it's an integer.
PB 4.30
Code: Select all
onErrorGoto(?Fred)