Depends what you mean by truly random numbers... You can't do it on a computer for a start. Pretty much all 'random number' functions rely on pre-defined lists of numbers in some form or another. You normally have to give a seed (time in ms is often used), but if you know the seed you'd be able to work out what the number was. Even if you had a (physical) lottery-style ball mixer, I wouldn't say that was truly random, as if you knew the exact position of every atom, and the laws of physics, you could work out what a number would be. It isn't possible to know the exact position of every atom, so we could never do this, but it's still not truly random. Hope that helps. G
Joined: Nov 02, 2000
This is true. I'm looking for anything more than Pseudo-Random. The docs in the Java Visual Age mention a lot of Pseudo-Random functions that repeat and are hardily even close to random. The same numbers come up everytime I restart my program. I'm looking for something that doesn't come up with the same numbers come up everytime. This is a bit more clear?
------------------ What's this H2SO4 doing in my fridge?? ( thud )
Normally the way that I do a pseudo random number is by setting the seed to the system time. For example: (Like Grant Crofton suggested) <CODE> Random myRandom = new Random( System.currentTimeMillis() ); </CODE> Since your system time is *somewhat* hard to guess correctly to the millisecond, this works as a good seed for randomizing. Hope this helps.