david bandel <Sh*******@gmail.com> wrote:
how do i make the random function be seeded by the timer? from the
complete lack of any resources on the web dealing with this i'm
assuming this is an extremely nontrivial problem. is there some magical
new technique for randomization that just makes no use of random
numbers? something specific to dot net.
No, I think there's a lack of resources on the web because it *is*
trivial :)
From the docs for the parameterless constructor for System.Random:
<quote>
Initializes a new instance of the Random class, using a time-dependent
default seed value.
</quote>
Alternatively, use the version which is given an int, and generate that
from the timer in whatever fashion you want.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too