Jesper Lund wrote:
Apart from the fact that this is DJGPP-specific, there is another caveat. The documentation states that the use of `uclock' *may* (on some systems) interfere with the proper working of the system time.
Oh well... :-(
So, perhaps it's better to use just the 1/18.2 s system clock then...
I understand the need for something like Randomize in game programming (I guess I am thinking too much about scientific purposes). But, as Peter pointed out, the program should only call Randomize once (at the beginning), and rely on repeated calls to the Random function to generate a sequence of numbers that -- for all practical purposes -- looks random. In that case, using hours, minutes and seconds from the system time, or the Unix approach with GetPID, should be perfectly satisfactory.
I may be missing something (I *am* totally ignorant about game programming), but to me the discussion about lack of randomness unless 1/100 or 1/1000 seconds are used sounds like calling Randomize before *each* call to Random?
I think so. However, 1 second may be a bit too long for short command line programs that use random (perhaps a fortune teller). A user could call the program more than once a second. (Though this doesn't seem to be a big problem.)