Random Seed

new topic     » topic index » view thread      » older message » newer message

It's probably too late to make any changes in 2.5, but for future reference:

There seems to be a discrepancy between running standard source
and bound files, with regard to the initial random seed.  The following code:

for t=1 to 10 do
    ?rand(5)
end for


produces a different sequence of numbers each time it is run as
source (with EX; I haven't tried EXW); but when bound the sequence
is always the same.  I take this to mean that the initial seed for
the random number function is fixed for the bound file. I don't
know which way was intended, but the source method seems preferable--
if you want a predictable random sequence you can just use set_rand().

--
Michael Bolin

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu